C
CodeGrommet
Hi all. The following code gives the error below. I'm coding against
minGW. I would appreciate it if someone could tell me where I have
gone wrong.
/*********************************** code
*******************************************/
#include <iostream>
using namespace std;
int main(){
string dogs[][] = { {"terry", "brown"} ,
{"Kristin", "white"} ,
{"toby", "gray"},
{"fido", "black"}
};
cout<<dogs[0][0]<<endl;
}
/******************************** error message
**********************************/
C:\unisa\MyFiles\Test_bin\simple_double_array_output.cpp
[Warning] In function `int main()':
error C:\unisa\MyFiles\Test_bin\simple_double_array_output.cpp:5
declaration of `dogs' as multidimensional array must have bounds for
all dimensions except the first
error C:\unisa\MyFiles\Test_bin\simple_double_array_output.cpp:10
`dogs' undeclared (first use this function)
[Build Error] (Each undeclared identifier is reported only once for
each function it appears in.)
/
************************************************************************************/
minGW. I would appreciate it if someone could tell me where I have
gone wrong.
/*********************************** code
*******************************************/
#include <iostream>
using namespace std;
int main(){
string dogs[][] = { {"terry", "brown"} ,
{"Kristin", "white"} ,
{"toby", "gray"},
{"fido", "black"}
};
cout<<dogs[0][0]<<endl;
}
/******************************** error message
**********************************/
C:\unisa\MyFiles\Test_bin\simple_double_array_output.cpp
[Warning] In function `int main()':
error C:\unisa\MyFiles\Test_bin\simple_double_array_output.cpp:5
declaration of `dogs' as multidimensional array must have bounds for
all dimensions except the first
error C:\unisa\MyFiles\Test_bin\simple_double_array_output.cpp:10
`dogs' undeclared (first use this function)
[Build Error] (Each undeclared identifier is reported only once for
each function it appears in.)
/
************************************************************************************/