What is the Caret Qualifier??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    What is the Caret Qualifier??

    I am not a Java or C# person and I have been seeing this as purported C++:
    [code=c]
    String ^g;
    [/code]

    What does the ^ mean?

    No info in my C# text and no info I could find with Google.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by weaknessforcats
    I am not a Java or C# person and I have been seeing this as purported C++:
    [code=c]
    String ^g;
    [/code]

    What does the ^ mean?

    No info in my C# text and no info I could find with Google.
    http://msdn2.microsoft.com/en-us/library/zkacc7k1.aspx ??

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      Unless I'm mistaken, that doesn't explain the usage as a unary operator Aaron (as in this example). Not that I can help I'm afraid :(

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by weaknessforcats
        I am not a Java or C# person and I have been seeing this as purported C++:
        [code=c]
        String ^g;
        [/code]

        What does the ^ mean?

        No info in my C# text and no info I could find with Google.
        In Pascal and Modula the prefix unary '^' means 'pointer to'; but I don't know
        what it is supposed to mean in other languages.

        kind regards,

        Jos

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          I wonder if they're getting confused with a regular expression part.

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            Originally posted by NeoPa
            Unless I'm mistaken, that doesn't explain the usage as a unary operator Aaron (as in this example). Not that I can help I'm afraid :(
            Sure, sure...just make fun of my response but don't offer anything of your own! Bah, a pox upon you!

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32633

              #7
              : D

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                I've always thought of this as a pointer to a .Net Object. Used only with .Net objects in C++.

                I've never seen it used in normal C++, just with that .Net MFC stuff.
                Check out the C++ example in the msdn ArrayList documentation.

                I'm not all that good with C++ so this may be all wrong :P

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by Atli
                  I've always thought of this as a pointer to a .Net Object. Used only with .Net objects in C++.

                  I've never seen it used in normal C++, just with that .Net MFC stuff.
                  Check out the C++ example in the msdn ArrayList documentation.

                  I'm not all that good with C++ so this may be all wrong :P
                  If Microsoft calls this:

                  [code=cpp]
                  void PrintValues( IEnumerable^ myList );
                  [/code]

                  ... C++ they've gone completely nutters. 'nuff said.

                  kind regards,

                  Jos

                  Comment

                  • Banfa
                    Recognized Expert Expert
                    • Feb 2006
                    • 9067

                    #10
                    Originally posted by JosAH
                    If Microsoft calls this:

                    [code=cpp]
                    void PrintValues( IEnumerable^ myList );
                    [/code]

                    ... C++ they've gone completely nutters. 'nuff said.
                    It's Managed C++ or C++/CLR which has some sytatic differences from actual C++ but can make .NET calls. It's C++.NET :D

                    Comment

                    • JosAH
                      Recognized Expert MVP
                      • Mar 2007
                      • 11453

                      #11
                      Originally posted by Banfa
                      It's Managed C++ or C++/CLR which has some sytatic differences from actual C++ but can make .NET calls. It's C++.NET :D
                      *eeewww!* Stay from me thou speaker in many tongues! <holds up a wooden cross/>

                      kind regards,

                      Jos ( <--- they've gone completely bonkers alright ;-)

                      Comment

                      • drhowarddrfine
                        Recognized Expert Expert
                        • Sep 2006
                        • 7434

                        #12
                        lol .

                        Comment

                        • r035198x
                          MVP
                          • Sep 2006
                          • 13225

                          #13
                          When is someone going to ask why this thread is here and not in some other location?

                          Comment

                          • Banfa
                            Recognized Expert Expert
                            • Feb 2006
                            • 9067

                            #14
                            Originally posted by r035198x
                            When is someone going to ask why this thread is here and not in some other location?
                            I bet on 25th October at 3:07:24.55 am

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32633

                              #15
                              Good point Evans. I'll move it to C / C++ forum.

                              Comment

                              Working...