Hi, I'm sorry I don't have my actual code to show give an example, at this time, but I'll try to recreate my problem for you.
Using Dev C++ as a compiler, I found that if I define a character array in a structure and initialized the array inside of main I would get an "Invalid conversion from 'const char*' to 'char'" error.
Can anyone tell me why this is and how it could be fixed?
Here is some example code:
Code:#include <iostream.h> struct foo { char foofoo[10]; // I also tried " char foofoo[] " }; int main() { foo footwo; footwo.foofoo[4] = "Foo"; // I also tried just " footwo.foofoo " without // the array. cout << footwo.foofoo; cin.get(); return 0; }Code:10 | C:\Documents and Settings\Owner\My Documents\Source Code\RPG.cpp | invalid conversion from `const char*' to `char'



LinkBack URL
About LinkBacks


