Sunday, January 28, 2007

string and charecter array

Strings are const char arrys, they are readonly, cannot be modified
eg:
char *a="hello";
*a='b'; --> Causes runtime errors

Arrays are allocated in user data area and can be modified.
eg:
char a[]="hello";
*a='b';
cout<-->prints bello.

No comments:


View My Stats

Click here to submit your site to the search engines for free!