|
From: Pink B. <da...@ya...> - 2008-03-30 17:16:33
|
Per Westermark sez, > No, I do not think you understand the other warnings. > > You should not treat them as warnings, since in reality > they are not warnings but errors. You have completely > misunderstood the strcat() function. Um... it's not that its just a misunderstanding of what a string is in C. In a lot of languages, strings are really strings, with a defined length, and helpful built in stuff to allocate memory for them etc etc. In C a string is nothing more than an static array of char. Hopefully with a NULL char marking the end of the string. Thats hopefully because if it's not there then really bad things happen because C doesn't have bounds checking on arrays. Which means it's very easy to do things like copy data past the end of a string, thus corrupting memory. PS: When I get a warning I always look to see what is causing it and then do the appropriate cast or what not to make it go away. Mr Foo |