hi guyz...
here's a pretty silly doubt that's been lingering fr a while..
why does the following code not work??

 char *s;
 char a='x';
 char b='y';



the program comes to halt inappropriately on running the above...
can someone please explain the fault...

I think the pointer is not initialized so when you try to dereference it the first time *s = a; it crashes. Setting s = &a; in conjunction with s = &b; after incrementing the pointer also works. Your cout should be dereferenced to view the char.