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 Postu cant assign an element at each position as u r doing.. u doing it like this rite..??
a[3]="a";
pls post the code..
the part where u re passing the parameter u have to receive a pointer.. then everything should be fixed i think.. anyway better u post the code.. …
Jump to PostWhat's the compiler error?
Jump to Post>void draw(char, int, int);
char is not the same as a two dimensional array of char.
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.