Pages

July 25, 2010

Revew OOP244 - Array and Pointer

y=NULL;
cout < < y; output is 0 double* address= NULL; y=*address; cout< < y; output is segementation fault

Tips on char* and char array
 char str[] = "This is OOP244";
char* s;

s = &str[8]; // points to the first 'O' in OOP244
cout << *(s + 3) << endl; // displays 244

No comments:

Post a Comment