Archived

This topic is now archived and is closed to further replies.

hello_there

char array

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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[ i ][ j ][ k ][ m ][ 0 ], "none" );
}
}
}
}

Share this post


Link to post
Share on other sites