str_cpy() in Lite-C? I'm going nuts!

Posted By: Michael_McCrickard

str_cpy() in Lite-C? I'm going nuts! - 05/12/09 15:16

Can anyone tell me why I can't make str_cpy() work in Lite-C? I never had any troubles with it in C-Script.

Here's my entire program:

////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////////////////////////////////

STRING* s;
STRING* s2;

function main()
{
video_mode = 7;
screen_color.blue = 150;

//this one gives an error
str_cpy(s, "test");

//this one also gives an error
//str_cpy(s, s2);
}
Posted By: Widi

Re: str_cpy() in Lite-C? I'm going nuts! - 05/12/09 15:25

STRING* s = "";
STRING* s2 = "";

You have to define the string Pointer with "=" before you can copy something into it.
Posted By: Michael_McCrickard

Re: str_cpy() in Lite-C? I'm going nuts! - 05/12/09 15:30

Hey, thanks a lot! That was exactly the problem, of course. This Lite-C stuff makes me feel like a real noob ...
© 2024 lite-C Forums