Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,246 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to initialize a variable array? #405967
08/11/12 18:22
08/11/12 18:22
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
so now i try to initialize a variable array like this:

int amount=6;
int test_array[amount];

but it seems not to work

someone has a solution?

thanks in advance

Re: how to initialize a variable array? [Re: pjotr987] #405969
08/11/12 19:05
08/11/12 19:05
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

Code:
int amount = 6;
int *test_array = sys_malloc ( sizeof(int) * amount );



Salud!

Re: how to initialize a variable array? [Re: pjotr987] #405970
08/11/12 19:16
08/11/12 19:16
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
I think you wanted to write declare instead of initialize.
txesmi sent to you a correct reply how to declare an array.
You shouldn't forget to initialize it, after the declaration.

Re: how to initialize a variable array? [Re: Aku_Aku] #405978
08/11/12 23:18
08/11/12 23:18
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
Originally Posted By: Aku_Aku

You shouldn't forget to initialize it, after the declaration.


it initializes the array too.

Re: how to initialize a variable array? [Re: txesmi] #405982
08/12/12 00:28
08/12/12 00:28
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
thank u very much it works perfectly!
thanks again

Re: how to initialize a variable array? [Re: txesmi] #406020
08/12/12 19:19
08/12/12 19:19
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Hmm... Thanks.


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