Question:

What is the difference between these 2 lines?

by  |  earlier

0 LIKES UnLike

What do ^ and * do, for example:

char* k;

System::Diagnostics::Process^ k = gcnew Process();

Thanks

 Tags:

   Report

1 ANSWERS


  1. Not sure what the ^ does, but it looks like its a function pointer (I don't know for sure. It depends on what gcnew Process() returns)

    The * means "pointer". So in this case, it means a "pointer to a character" which in classic C/C++ basically means "String".

    the way you use the * for strings in C++ goes something like this

    char * HelloWorld = new char[strlen("Hello World"+1)];

    assert(HelloWorld!=NULL);

    strcpy(HelloWorld,"Hello World");

    cout << HelloWorld.

    Output:

    "Hello World"

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.