char array

Started by
4 comments, last by hello_there 20 years, 8 months ago
i have this array for holding names of files char positions[4][10][100][100][100]; yes i know it''s huge. i want to initalise the whole thing so that all of the things = none. i can''t seem to get it to work anyone know how?
____________________________________________________________How could hell be worse?
Advertisement
you could just use nested loops and go through setting each one individually.
Rodger
i did that didn''t work.

i did this in the loop but it woukldn''t compile.

positions[4][10][100][100][100]="none";

i''m not to sure how you do it i also tried this.

positions[4][10][100][100][100]={''n'',''o'',''n'',''e''};

neither worked.
____________________________________________________________How could hell be worse?
you did this "positions[4][10][100][100][100]="none"; "?? i hope you werent using 4,10,100 in your loop.
and what are you needing 38mb of filenames for, why store them in such a strange way?
f@dzhttp://festini.device-zero.de
char positions[4][10][100][100][100];for ( int i = 0; i < 4; i++ ){    for ( int j = 0; j < 10; j++ )    {        for ( int k = 0; k < 100; k++ )        {            for ( int m = 0; m < 100; m++ )            {                strcpy( &positions[ j ][ k ][ m ][ 0 ], "none" );<br>            }<br>        }<br>    }<br>}<br> </pre>    
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
quote:i did that didn''t work.


then that''s because u didn''t do it right. nested for loops will work, as has been displayed just above.
GSACP: GameDev Society Against Crap PostingTo join: Put these lines in your signature and don't post crap!

This topic is closed to new replies.

Advertisement