String^

This is a discussion on String^ within the C++ Programming forums, part of the General Programming Boards category; Hi guys, i have recently stumbeled accross this array<String^>^args, what on earth is a String ^ ? i tried looking ...

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    32

    String^

    Hi guys,
    i have recently stumbeled accross this array<String^>^args, what on earth is a String ^ ? i tried looking for documentation on this but found nothing
    br

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    This is C++/CLI or Managed C++, not standard C++, so I would look into THAT sort of documentation.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    330
    thats a microsoft VC.NET specific extension.
    It means that it is a garbage collected pointer in the .NET framework.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    It depends on whether it's Managed C++ or C++/CLI. The former is an extension, the later is not.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by KIBO View Post
    thats a microsoft VC.NET specific extension.
    It means that it is a garbage collected pointer in the .NET framework.
    Hooray for MS's work on making C++ unreadable. What's wrong with a class like shared_ptr anyways... I wonder how they're going to hack-fix it for C++0x, I guess they'll have to keep both. Ouch...

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    Eh, they're two different things.
    The C++/CLI pointers are part of dotCrap, and therefore must adhere to its rules, such as garbage collection. That's just unavoidable. That avoid mixing managed and unmanaged types, they introduced new syntax. But boy, I do agree with you that it's ugly.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Jul 2010
    Posts
    32
    so how would i convert a ^String to a regular string?

  8. #8
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    The most likely solution is to NOT use C++/CLI. You probably don't need it. If you'd need it, you'd know. Start a new project and use Win32 Console or whatever you need.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  9. #9
    Registered User
    Join Date
    Jul 2010
    Posts
    32
    i am afraid i can not avoid it, i am using FileWatch which forces me to use this, which is why i really need to find a way to convet a ^String into a string or char * type
    br

  10. #10
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Did you try Google? It's only one of the most frequently asked questions about C++/CLI.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  11. #11
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Let me ask the next obvious question: if you need FileSystemWatcher from the .NET Framework, why are you using C++? Why not C#?
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  12. #12
    Registered User
    Join Date
    Jul 2010
    Posts
    32
    i am a C++ guy not a C# person

  13. #13
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    Use the right tool for the job I say.

    So if you are just using "C++" just cause you are a C++ guy, that is kind of a waste unless you are looking for a learning experience. Of course if this is for a job or school and are forced too, what can you do
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pass value from Form3 to Form2
    By franse in forum C++ Programming
    Replies: 15
    Last Post: 11-07-2008, 11:07 AM
  2. Getting a std string into a String^
    By ac251404 in forum Windows Programming
    Replies: 2
    Last Post: 07-18-2006, 12:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21