-
errors in class(urgent)
im attaching my .cpp code file with errors. PLEASE tell me what these errors mean. there are only 2 errors in the code actually.....PLEASE help me correct those errors and ALSO, do i need to add void main() to end the program?
THANK U......VERY MUCH.:)
--------------------Configuration: dice - Win32 Debug--------------------
Compiling...
dice.cpp
C:\My Documents\Ayesha Karim\dice.cpp(28) : error C2064: term does not evaluate to a function
C:\My Documents\Ayesha Karim\dice.cpp(29) : error C2064: term does not evaluate to a function
C:\My Documents\Ayesha Karim\dice.cpp(30) : error C2064: term does not evaluate to a function
C:\My Documents\Ayesha Karim\dice.cpp(31) : error C2064: term does not evaluate to a function
C:\My Documents\Ayesha Karim\dice.cpp(32) : error C2064: term does not evaluate to a function
C:\My Documents\Ayesha Karim\dice.cpp(57) : error C2440: '=' : cannot convert from 'char [6]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(58) : error C2440: '=' : cannot convert from 'char [7]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(59) : error C2440: '=' : cannot convert from 'char [7]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(60) : error C2440: '=' : cannot convert from 'char [7]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(61) : error C2440: '=' : cannot convert from 'char [6]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(62) : error C2440: '=' : cannot convert from 'char [11]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(76) : error C2440: '=' : cannot convert from 'char [4]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(77) : error C2440: '=' : cannot convert from 'char [4]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(78) : error C2440: '=' : cannot convert from 'char [5]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(79) : error C2440: '=' : cannot convert from 'char [6]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(80) : error C2440: '=' : cannot convert from 'char [7]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\My Documents\Ayesha Karim\dice.cpp(81) : error C2440: '=' : cannot convert from 'char [7]' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
dice.obj - 17 error(s), 0 warning(s)
-
What about the .h file??
When I ran the program it said i needed the .h file which you haven't oploaded.
-
The ones that say "cannot convert" blah blah blah are occuring because you are trying to make a constant, the character 's' in this case equal a string of constants. This doesn't make much sense. First of all you should have a string, not just a single character for the variable string...you could have:
char *string;
or
char string[MAX_STRING_LEN];
where MAX_STRING_LEN is some integer value. Seconds, instead of setting 's' equal to apple, bannana, etc., set string equal to it, but you need to use something like strcpy(), strcat() or a manual copy of each character. Look up strcpy(). Not sure about the first error, unless you didn't define those functions in your class definition, include your header files next time so I can see the class please. ty