I want to use multiple string arrays. I just started my program and I have an error of
7 `std::string time[500][1]' redeclared as different kind of symbol
My code is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include <iostream>
#include <string>
using namespace std;
int i;
string plane[500][1];
string time[500][1];
int terminal[500][1];
int runway[500][1];
int main() {
i=0;
plane[i]="Flight815";
cout << plane[i];
cout << "Welcome to the air traffic control program or A.T.C.P.. What would you like your A.T.C.P. do?";
i++;
plane[i]="Flight816";
cout << plane0 << plane1;
}
|
I am making this program to learn more about the language. I am trying to get strings of these categories (being the array names) to make an history of the plane flights (made up of course) for a log and also make sure the plane's flights don't interfere with each other. I put in the last few lines of code to test this program. My other errors are
85 C:\ProgramFiles\Dev-Cpp\include\time.h previous declaration of `time_t time(time_t*)'
7 declaration of `std::string time[500][1]'
85 C:\ProgramFiles\Dev-Cpp\include\time.h conflicts with previous declaration `time_t time(time_t*)'
In function `int main()':
12 incompatible types in assignment of `const char[10]' to `std::string[1]'
16 incompatible types in assignment of `const char[10]' to `std::string[1]'
17 `plane0' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
17 `plane1' undeclared (first use this function)