-
Confused... char[10][50]
Okee, if I do this:
char stuff[10][50];
that makes an array of 10 arrays of 50 chars, right? but if I remember correctly, just going "char stuff[50];" will fill stuff with random values (pleeeeease correct me if I'm wrong right here). So, by my reasoning, each of the 10 arrays will be filled with garbage. Can I just go "char stuff[10][50] = {0};"?
-
>but if I remember correctly, just going "char stuff[50];" will fill
>stuff with random values (pleeeeease correct me if I'm wrong right here
If the array is a non-static local variable then you are correct. The initial value of the array is indeterminate.
>Can I just go "char stuff[10][50] = {0};"?
Yes, this will fill the entire array with 0.
-Prelude
-