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. A push in the right direction please.

A push in the right direction please.

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 2 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.
  • M Offline
    M Offline
    mcgahanfl
    wrote on last edited by
    #1

    The question states. Write the following code and discuss what exactly results. enum logical { no, maybe, yes }; I get the enum part, no = 0, maybe = 1 and yes = 2. But what is the 'logical' part? A logical |, or perhaps a logical & Thanks for a push in the right direction.

    D 1 Reply Last reply
    0
    • M mcgahanfl

      The question states. Write the following code and discuss what exactly results. enum logical { no, maybe, yes }; I get the enum part, no = 0, maybe = 1 and yes = 2. But what is the 'logical' part? A logical |, or perhaps a logical & Thanks for a push in the right direction.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      McGahanFL wrote: But what is the 'logical' part? It's the name of the set (i.e., type). As an added bonus, how would your answer change, if at all, if I were to change the statement to:

      enum logical { no, maybe = 3, yes };


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      M 1 Reply Last reply
      0
      • D David Crow

        McGahanFL wrote: But what is the 'logical' part? It's the name of the set (i.e., type). As an added bonus, how would your answer change, if at all, if I were to change the statement to:

        enum logical { no, maybe = 3, yes };


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        M Offline
        M Offline
        mcgahanfl
        wrote on last edited by
        #3

        Are you saying I can replace the word 'logical' with types like int or CString? I don't think that is what you mean. bonus question no = 0, maybe =3, yes = 4 ------------------------- logical operator &&(logical a, logical b); thansk

        D 1 Reply Last reply
        0
        • M mcgahanfl

          Are you saying I can replace the word 'logical' with types like int or CString? I don't think that is what you mean. bonus question no = 0, maybe =3, yes = 4 ------------------------- logical operator &&(logical a, logical b); thansk

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          McGahanFL wrote: Are you saying I can replace the word 'logical' with types like int or CString? No, not at all. The word following the enum keyword is the name of your new type, like animal, position, or vehicle. McGahanFL wrote: bonus question no = 0, maybe =3, yes = 4 Very good. You have a firm grasp on the subject.


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          M 1 Reply Last reply
          0
          • D David Crow

            McGahanFL wrote: Are you saying I can replace the word 'logical' with types like int or CString? No, not at all. The word following the enum keyword is the name of your new type, like animal, position, or vehicle. McGahanFL wrote: bonus question no = 0, maybe =3, yes = 4 Very good. You have a firm grasp on the subject.


            "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

            M Offline
            M Offline
            mcgahanfl
            wrote on last edited by
            #5

            OK, thanks. Let me work with that for a while.

            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