C++:OK Java Error Comma operator int a,b; a = (b=3,b+2);
Both ways of initializing variables are valid and equivalent in C++ int a = 5; int b (10); but in java we use int a = 5; int b(10) is invalid
C++ : char ch_str = "success"; OK but char[] ch_str = "success"; ERROR in Java all Error! but in java: char[] ch_str = {'s','u','c','c','e','s','s'};OK and also char ch_str[]=..; C++: string str = "mystr"; char *p = (char*)str.c_str();//be sure that (char*)!! for(int i = 0;i cout<<"pos "+i<<*p++;
} result will be like this: pos 0.., os 1 .., s 2 .. in Java will be like this: pos 0 m,pos 1 y,... so ....