Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, TipmyPip, degenerate_762, AndrewAMD, Nymphodora), 997 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_cpy not work #471787
03/19/18 20:25
03/19/18 20:25
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
hello,
i hate my 3dgs problems but must rely ask you, on my win8.1 (3dgs is installed in c:GStudio8)
why code not work for me?
Code:
#include <acknex.h>
#include <default.c>
#include <strio.c>;
STRING* srt100;
function main()
{
	level_load(NULL);
	str_cpy(srt100,"a"); // string has now empty content
}



iger Error E1515
(X) Invalid function arguments in main

P.S. i have make changes in atypes. but I have install 3dgs new and the first time, the installer told me to restart windows

Re: str_cpy not work [Re: CocaCola] #471789
03/19/18 20:50
03/19/18 20:50
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
when we write
Code:
STRING *str100;


we are declaring an empty STRING pointer.

Code:
STRING *str100 = "";


Declares a STRING pointer that points to a newly created empty STRING struct. But only in global STRING pointers. For local pointers you must create it with str_create and remove it at the end.

Code:
STRING *strLocal = str_create("");
...
str_remove(strLocal);
strLocal = NULL;



Salud!

Last edited by txesmi; 03/19/18 20:51.
Re: str_cpy not work [Re: txesmi] #471791
03/19/18 20:58
03/19/18 20:58
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
yea, super thank you txesmi

have i to write
Code:
strLocal = NULL;

after
Code:
str_remove(strLocal);

?

Re: str_cpy not work [Re: CocaCola] #471794
03/19/18 21:02
03/19/18 21:02
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Not really, but nullifying your empty pointers is a good practice

Re: str_cpy not work [Re: txesmi] #471798
03/19/18 21:27
03/19/18 21:27
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
i will do it so, thats perfekt for my editor programm, its the basic for diferent projekts i will make with 3dgs.
thank you for your help.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1