
Originally Posted by
Silentknife
Though on some (slightly older) compilers it can give you "non-static reference member" issue and refuse to compile if two pointers go to 1 location, for example, a program which otherwise works fine, but if you point:
Refuses to compile with assignment error in Borland C++ 4.9 "non-static reference member"
Those aren't pointers. They're classes. And they can't be initialized by using that method, you have to call their constructor(provided it's not static).
Any type declaration with the * suffix makes it a pointer. Consider:
char* ptr1 = "pointer 1";
char* ptr2 = ptr1;
Both pointers point to the same location.
or
char* ptr1 = "a";
char* ptr2 = "a";
Both pointers point to different locations with similar data(unless the code goes through optimization, there is a chance they may point to the same location.)
string myString = new string(some constructor arguments);
string* stringPtr = &myString;
stringPtr points to myString.

Originally Posted by
why06
Let me speak from experience, from switching over from Java to C++, that the similarities in style and syntax outweigh the differences. Technically speaking in the way the two languages compile and run they are much different, but the syntax for most every HLL is pretty similar, and I found the transition very easy. Haha even though I did have some trouble getting used to the way C++ does strings, and not having garbage collection...
I beg to differ. Just the fact that java runs in a VM vs C++ which is directly executed is a huge difference. Also consider that most java programmers don't communicate with the operating system directly, AT ALL. C and C++ the programmer is generally always communicating with the operating, regardless if it is small or large. If you work with any large scale projects you will find a considerably MASSIVE difference. Another big one, you have so little control over memory in java you don't even have the ability to use pointers(real pointers, that point to actual locations in memory), where as in C and C++, you have to be aware of everything that is happening in memory.