Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 01/31/26 08:02
Lapsa's very own thread
by Lapsa. 01/30/26 19:44
Zorro version 3.0 prerelease!
by TipmyPip. 01/30/26 13:36
Historical Data with the 64bit FXCM Plugin
by Martin_HH. 01/28/26 18:45
SGT_FW
by Aku_Aku. 01/27/26 15:10
Buy A8 Pro Version
by Ezzett. 01/26/26 14:22
C++ direct start requires Zorro S
by jcl. 01/23/26 14:29
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 9,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Sfrdragon, mayarik, Castromangos, Quantum, stephensdeborah
19195 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Passing array as argument to a function #486455
08/21/22 09:23
08/21/22 09:23
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
Casablanca, Morocco
Hello guys,

I just want to know why I can't use an array as an argument in C-lite, I think it's not possible, can someone please tell me if it's supported or not? thanks in advance =)

this code compiles normally :
Code
void delete_from_array(int index_to_del){	
}



this code does not compile and returns "syntax error" :
Code
void delete_from_array(int index_to_del, float array_to_del_from[]){	
}



Many thanks

Last edited by anissyo; 08/21/22 10:39.
Re: Passing array as argument to a function [Re: anissyo] #486458
08/22/22 16:00
08/22/22 16:00
Joined: Feb 2017
Posts: 1,811
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,811
Chicago
In Lite-C, you use a pointer instead. So this likely does what you want:
Code
void delete_from_array(int index_to_del, float* array_to_del_from){

    //examples:
    float foo = array_to_del_from[3];
    array_to_del_from[2] = 0;
}

Re: Passing array as argument to a function [Re: AndrewAMD] #486462
08/23/22 13:42
08/23/22 13:42
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
Casablanca, Morocco
Thank you so much Andrew for your help =) =)

Last edited by anissyo; 08/23/22 13:46.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1