0

Basically I've got a const string (it stays the same lenght) Only trying to implement it into OOP.

heres the constructor:

score::score(void)
{
	lives = 5;
	char * end = 
	{
	" --------------+-\n"
	" +             |\n "
	"+             ?\n"
	" +\n"
	" +\n"
	" +\n"
	" +\n"
	};

		strcpy( death, end);

}

but the program fails to run when I excute it, so kinda stuck and puzzled.

3
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by Stoned_coder
0

probably should be char end[] = not char * = . Also, where is death defined (and how big is it?)

0

probably should be char end[] = not char * = . Also, where is death defined (and how big is it?)

when I try and compile it with that i get:

main.obj : error LNK2001: unresolved external symbol "public: char * __thiscall score::dead(void)" (?dead@score@@QAEPADXZ)
Debug/main.exe : fatal error LNK1120: 1 unresolved externals

0

post your score class and we will take a look for you. there isnt enough code to help there. It appears that maybe you have forgotten to write a member func or something similar.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.