I am actually having two problems. The first is initializing a char array to a single space for all elements. I have the loop to do this but the assignment to the value: " " is returning a compile error: error: invalid conversion from `const char*' to `char'. Then, when I am passing the array to a funtion, I get the error message: error: invalid conversion from `char (*)[3]' to `char'. Any help would be greatly appreciated. I can try to copy code here as well if it will help.
sifuedition 0 Light Poster
Recommended Answers
Jump to PostPost the code. However, the error you are getting in your array is that you're probably trying to assign " " rather than ' ' for a single character.
You can also use memset ( variable, ' ', size ); or if you are using C++ and the string …
Jump to Post>void draw(char, int, int);
char is not the same as a two dimensional array of char.
Jump to Post>Any ideas?
Yes, you could stick your head in a bucket of jello twice a day and run around the office naked screaming the national anthem at the top of your lungs.>void draw(char[], int, int);
...An array of char isn't the same as a two dimensional array of …
Jump to Post>You could also change it to char **
No, you couldn't because the argument is a two dimensional array. The "arrays are converted to pointers" rule only applies to the first dimension, so a[M][N] is equivalent to (*a)[N], but not equivalent to **a.>much like it is often defined …
All 13 Replies
winbatch 7 Posting Pro in Training
shre86 0 Light Poster
sifuedition 0 Light Poster
sifuedition 0 Light Poster
winbatch 7 Posting Pro in Training
sifuedition 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
sifuedition 0 Light Poster
sifuedition 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
winbatch 7 Posting Pro in Training
sifuedition 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.