943,662 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1290
  • C RSS
Oct 5th, 2005
0

copying unknown string lenghts

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

heres the constructor:

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

strcpy( death, end);

}[/php]

but the program fails to run when I excute it, so kinda stuck and puzzled.
Similar Threads
Reputation Points: 12
Solved Threads: 5
Posting Pro
Acidburn is offline Offline
510 posts
since Dec 2004
Oct 5th, 2005
0

Re: copying unknown string lenghts

probably should be char end[] = not char * = . Also, where is death defined (and how big is it?)
Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005
Oct 5th, 2005
0

Re: copying unknown string lenghts

Quote originally posted by winbatch ...
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:

Quote ...
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
Reputation Points: 12
Solved Threads: 5
Posting Pro
Acidburn is offline Offline
510 posts
since Dec 2004
Oct 5th, 2005
0

Re: copying unknown string lenghts

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.
Reputation Points: 19
Solved Threads: 5
Junior Poster
Stoned_coder is offline Offline
164 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: modululs equivalent for large numbers?
Next Thread in C Forum Timeline: How to log rs232 port activity under win32 ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC