What is the correct form to initialize a multiscripted array?
1-
2-Code:char names[3][11] = {{"texto1.txt"}, {"texto2.txt"}, {"texto3.txt"}};
Thanks.Code:char names[3][11] = {"texto1.txt", "texto2.txt", "texto3.txt"};
This is a discussion on Initializing multiscripted arrays within the C Programming forums, part of the General Programming Boards category; What is the correct form to initialize a multiscripted array? 1- Code: char names[3][11] = {{"texto1.txt"}, {"texto2.txt"}, {"texto3.txt"}}; 2- Code: ...
What is the correct form to initialize a multiscripted array?
1-
2-Code:char names[3][11] = {{"texto1.txt"}, {"texto2.txt"}, {"texto3.txt"}};
Thanks.Code:char names[3][11] = {"texto1.txt", "texto2.txt", "texto3.txt"};
Both of those forms.6.7.8 Initialization
14 An array of character type may be initialized by a character string literal, optionally enclosed in braces.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*