copying unknown string lenghts

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2004
Posts: 489
Reputation: Acidburn is an unknown quantity at this point 
Solved Threads: 5
Acidburn Acidburn is offline Offline
Posting Pro in Training

copying unknown string lenghts

 
0
  #1
Oct 5th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: copying unknown string lenghts

 
0
  #2
Oct 5th, 2005
probably should be char end[] = not char * = . Also, where is death defined (and how big is it?)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 489
Reputation: Acidburn is an unknown quantity at this point 
Solved Threads: 5
Acidburn Acidburn is offline Offline
Posting Pro in Training

Re: copying unknown string lenghts

 
0
  #3
Oct 5th, 2005
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:

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
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: copying unknown string lenghts

 
0
  #4
Oct 5th, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC