Gamestudio Links
Zorro Links
Newest Posts
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
How to select between IB accounts by script?
by Jack_Zodiac. 06/12/26 23:17
Zorro tutorial ideas?
by pr0logic. 06/12/26 13:36
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/12/26 08:50
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Quad, TipmyPip, 1 invisible), 2,064 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Copying strings to character array #456884
12/14/15 17:21
12/14/15 17:21
Joined: Apr 2015
Posts: 26
T
trader6363 Offline OP
Newbie
trader6363  Offline OP
Newbie
T

Joined: Apr 2015
Posts: 26
When I run the following code it returns "pointer expected" error.
function main(){
static char a[2][500];
strcpy(a[0],"string");
strcpy(a[1],"string1");
printf("%s %s",a[0],a[1]);
}

Anyway to copy strings to a 2 dimension character array so that I can later retrieve them by referencing the first dimension of that array?

Re: Copying strings to character array [Re: trader6363] #456899
12/15/15 09:17
12/15/15 09:17
Joined: Jul 2000
Posts: 28,101
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,101
Frankfurt
No, but you can either define a struct containing your 500 chars array, or simply:

char a[1000];
strcpy(a+0*500,"string0");
strcpy(a+1*500,"string1");


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1