Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Pointer Question

Status
Not open for further replies.

Elena

Technical User
Oct 20, 2000
112
US
This one has always bugged me. I am new to C/C++ (As if you guys couldn't tell). Anyway, when I look at some sample code, I see different ways of declaring a pointer(I think). I just want to make sure that there is no difference between:

char *string[64];

and

char * string[64];

They are both pointers to string, right? I see the latter much more frequently in sample code, but the former in most of the books I have read.

Thanks,
Elena

 
it is no difference. Just a pointer to a string.

Ion Filipski
1c.bmp
 
Just to elborate on IonFilipski's post, that is correct there is no difference in the 2 because white space doesn't matter in C/C++ (with a few exceptions).

You could also write the following:

char* string[64];
char * string[64];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top