| | |
copying unknown string lenghts
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
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.
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.
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
•
•
•
•
Originally Posted by winbatch
probably should be char end[] = not char * = . Also, where is death defined (and how big is it?)
•
•
•
•
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
•
•
Join Date: Jul 2005
Posts: 164
Reputation:
Solved Threads: 5
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.
![]() |
Similar Threads
- Need help with string manipulation and seg faults (C)
- Help! I'm new to pointers (C++)
- Problem formating VB string for clipboard (Visual Basic 4 / 5 / 6)
- casting error (Java)
Other Threads in the C Forum
- Previous Thread: modululs equivalent for large numbers?
- Next Thread: How to log rs232 port activity under win32 ?
| Thread Tools | Search this Thread |
Tag cloud for C
#include * append array arrays asterisks binarysearch calculate changingto char character cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fgets file fork forloop framework function functions givemetehcodez grade graphics gtkwinlinux hacking histogram homework inches include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft mqqueue number oddnumber odf opendocumentformat opensource overwrite owf pdf performance pointer posix problem probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi





