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. Hard question (maybe)

Hard question (maybe)

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

    typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent? Not a question, more in the form of a quiz. They say most progammers interperate this wrong.

    K N M D 4 Replies Last reply
    0
    • H hackC

      typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent? Not a question, more in the form of a quiz. They say most progammers interperate this wrong.

      K Offline
      K Offline
      Kharfax
      wrote on last edited by
      #2

      With your games you are sending real doubts down to the other page...

      1 Reply Last reply
      0
      • H hackC

        typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent? Not a question, more in the form of a quiz. They say most progammers interperate this wrong.

        N Offline
        N Offline
        Nick_Kisialiou
        wrote on last edited by
        #3

        Yeah, most programmers will really "interperate", especially those who post such questions. ;P

        1 Reply Last reply
        0
        • H hackC

          typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent? Not a question, more in the form of a quiz. They say most progammers interperate this wrong.

          M Offline
          M Offline
          Maxwell Chen
          wrote on last edited by
          #4

          #hackC++ wrote:

          typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent?

          Somebody please ask #hackC++ to use this way to get his answer by: std::cout << typeid(cstr).name();


          Maxwell Chen

          N 1 Reply Last reply
          0
          • H hackC

            typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent? Not a question, more in the form of a quiz. They say most progammers interperate this wrong.

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

            #hackC++ wrote:

            What is the type of cstr ?

            It is a const ptrstr, but it will need to be initialized.

            #hackC++ wrote:

            Not a question, more in the form of a quiz.

            How can it not be a question if it ends with a question mark?


            "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

            "We will be known forever by the tracks we leave." - Native American Proverb

            H 1 Reply Last reply
            0
            • M Maxwell Chen

              #hackC++ wrote:

              typedef string *ptrstr; const ptrstr cstr; //this is wrong What is the type of cstr ? What underlying type does a pointer const ptrstr represent?

              Somebody please ask #hackC++ to use this way to get his answer by: std::cout << typeid(cstr).name();


              Maxwell Chen

              N Offline
              N Offline
              Nick_Kisialiou
              wrote on last edited by
              #6

              Looks like he has just discovered C++ for himself and it thrills him...

              1 Reply Last reply
              0
              • D David Crow

                #hackC++ wrote:

                What is the type of cstr ?

                It is a const ptrstr, but it will need to be initialized.

                #hackC++ wrote:

                Not a question, more in the form of a quiz.

                How can it not be a question if it ends with a question mark?


                "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

                "We will be known forever by the tracks we leave." - Native American Proverb

                H Offline
                H Offline
                hackC
                wrote on last edited by
                #7

                my grammer and english is not what you call "good". bare with me. please. string *const cstr; is the correct way. -- modified at 14:56 Tuesday 25th April, 2006

                N D 2 Replies Last reply
                0
                • H hackC

                  my grammer and english is not what you call "good". bare with me. please. string *const cstr; is the correct way. -- modified at 14:56 Tuesday 25th April, 2006

                  N Offline
                  N Offline
                  Nick_Kisialiou
                  wrote on last edited by
                  #8

                  I think David is he not she, so he would not want to bare with you. :-D

                  1 Reply Last reply
                  0
                  • H hackC

                    my grammer and english is not what you call "good". bare with me. please. string *const cstr; is the correct way. -- modified at 14:56 Tuesday 25th April, 2006

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

                    #hackC++ wrote:

                    string *const cstr; is the correct way.

                    You wanted to know what cstr was, not ptrstr. cstr is a const ptrstr, while ptrstr is a string*. In any case, you are mistaken. While const string *cstr and string const *cstr are interchangeable, string* const cstr is completely different.


                    "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

                    "We will be known forever by the tracks we leave." - Native American Proverb

                    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