char var1, *ptr1; // <--- * goes here
var1='X';
ptr1=&var1;
It's important to remember that you need '*' for each pointer variable. Therefore: char* ptr1, ptr2; doesn't work as intended.
For two ptrs, you must do char *ptr1, *ptr2.
Ed[QUOTE=hfick]I am stuck on this problem..you are supposed to locate the error in the segment of code:
char var1, ptr1;
var1='X';
ptr1=&var1;
Can someone please help me figure this out. It is much appreciated.
I think their needs to be an * by the ptr1 where the variable is declared but I am really not sure.??