Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (blaurock), 750 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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