V
Virtual_X
some function make the data type of it's parameters as "const char*"
why not use char or char* instead
what would be different
why not use char or char* instead
what would be different
Virtual_X said:some function make the data type of it's parameters as "const char*"
why not use char or char* instead
what would be different
Victor said:The type 'char' can only help passing a _single_ character.
The type 'char*' can help passing an array of non-constant characters.
The type 'const char*' helps passing an array of constant characters.
It means the function needs an array (often it's a C-string),
A function which parameter is const char *, it can accept char * and
const char * type of argument.
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.