Raised This Month: $51 Target: $400
 12% 

Error 023 when setting a two dimensional array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FunPL
New Member
Join Date: Jul 2019
Old 07-07-2019 , 12:37   Error 023 when setting a two dimensional array
Reply With Quote #1

Why can't I set a two dimensional array? Here is a simplified example of what I'm doing:
Code:
char bplayerswaiting[99][99];
char playerstats[99][99];
public void test(){
    bplayerswaiting[0] = "test";
    playerstats = bplayerswaiting;//Error 023
}

Last edited by FunPL; 07-07-2019 at 12:41. Reason: Not found out?
FunPL is offline
Shane1390
Member
Join Date: Apr 2018
Old 07-07-2019 , 14:17   Re: Error 023 when setting a two dimensional array
Reply With Quote #2

What you're trying to do is clone the array, not set it; which is functionality provided for adt_array's

Essentially, you'll need to either iterate through "simple assignments" and set the entire array or change your approach.
Code:
char test1[10][10];
char test2[10][10];

FormatEx(test1[0], sizeof(test1[]), "test");

//will succeed (simple assignment)
test2[0] = test1[0];

//will error
test2 = test1;

Last edited by Shane1390; 07-07-2019 at 14:24. Reason: detail
Shane1390 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode