2 registered members (AndrewAMD, SBGuy),
987
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
can not str_cpy a global string
#471982
03/31/18 07:15
03/31/18 07:15
|
Joined: Mar 2014
Posts: 359
CocaCola
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2014
Posts: 359
|
hello, if i make #include <acknex.h> #include <default.c> #include <strio.c>;
/////////////////////////////// STRING* global_str=""; function iiiii(){.... str_cpy(global_str," ");
... } it not work, it woks onli with local string. why is it so?
|
|
|
Re: can not str_cpy a global string
[Re: CocaCola]
#471984
03/31/18 09:53
03/31/18 09:53
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Hi It actually does work, try this:
#include <acknex.h>
#include <default.c>
#include <strio.c>
STRING* global_str = "";
function main(){
str_cpy(global_str, " ");
str_cat(global_str, "hello world");
while(!key_esc){
draw_text(global_str, 10, 10, COLOR_WHITE);
wait(1);
}
}
|
|
|
Re: can not str_cpy a global string
[Re: CocaCola]
#472029
04/02/18 19:52
04/02/18 19:52
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
User
|
User
Joined: May 2005
Posts: 868
Chicago, IL
|
Okay, if you can choose files and play them, then that is a great start. Like me, you will write a function that does everything you need it to do. THEN you will discover that Lite-c has a built in command that does the same thing I would recommend posting a new topic, since this is different from your original problem.
|
|
|
|