cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Arrays with functions.
Arrays with functions.
Oct 22, 2011 at 5:47pm UTC
Ben Duncan
(163)
I'm attempting to put an array of chars into a function with a default value with this:
char
* Name[] =
"Millennium Munch"
as one of the arguments; I'm getting an error that says:
Error:default argument of type "const char *" is incompatible with parameter of type "char**"
Could anyone help me?
Thanks, Ben.
Oct 22, 2011 at 5:59pm UTC
quirkyusername
(792)
'Name' is an array of pointers to chars but you are trying to fill with chars. It needs to be an array of chars
char
Name[] =
"Millenium Munch"
;
Last edited on
Oct 22, 2011 at 6:00pm UTC
Oct 22, 2011 at 6:09pm UTC
Ben Duncan
(163)
O.K, thanks!
Topic archived. No new replies allowed.