Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Enumerated types

Enumerated types

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jay03
    wrote on last edited by
    #1

    Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused:

    R T J 3 Replies Last reply
    0
    • J Jay03

      Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused:

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      Enum values are always integers.


      "It's supposed to be hard, otherwise anybody could do it!" - selfquote

      1 Reply Last reply
      0
      • J Jay03

        Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused:

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        nope ; internally, enums are actually ints


        [VisualCalc][Flags Beginner's Guide] | [Forums Guidelines][My Best Advice]

        1 Reply Last reply
        0
        • J Jay03

          Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused:

          J Offline
          J Offline
          Jay03
          wrote on last edited by
          #4

          thanks for the ans boys

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups