B
batee5a
what is the difference between char* and char[]?????
batee5a said:what is the difference between char* and char[]?????
batee5a said:what is the difference between char* and char[]?????
In the context of a function parameter, nothing,
they both mean 'pointer to char'
In a declaration other than a function parameter,
The former signifies a pointer, the latter is
a syntax error.
char a[10];
p is of type pointer to char. It points somewhere but no one know where; it
shouldn't be used until that problem is taken care of.
a is a pointer to an array of 10 char in auto storage
Bob Hairgrove said:batee5a said:what is the difference between char* and char[]?????
In the context of a function parameter, nothing,
they both mean 'pointer to char'
In a declaration other than a function parameter,
The former signifies a pointer, the latter is
a syntax error.
Hmmm...
I think the OP was thinking about this:
const char msg[] = "Hello";
or this:
char buffer[256];
batee5a said:what is the difference between char* and char[]?????
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.