| | |
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 |
adobe ansi api array arrays asterisks bash binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming stack standard string strings structures suggestions system systemcall test testautomation unix user variable voidmain() wab win32api windows.h





