The compiler says...
initializer string for array of characters is too long---line 30
non-|value in assignment---line 32
parse error before string constant
Code:
#include <iostream.h>
#include <stdlib.h>
#include <fstream.h>
#define MAX 6
#define MAXLENGTH 8
#define MAXDAYS 7
#define DAYLENGTH 9
void seatarrange();
int main()
{
seatarrange();
system("PAUSE");
return 0;
}
void seatarrange()
{
int time;
int turn;
char seat[MAX][MAXLENGTH]={0};
char day[MAXDAYS][DAYLENGTH]={
"Monday" ,
"Tuesday" ,
"Wednesday" ,
"Thursday" ,
"Friday" ,
"Saturday" ,
"Sunday"};
ofstream a_file("C:/Windows/Desktop/Seating.txt");
for(turn=1 && time=1; turn <= MAX && time <= MAXDAYS; turn++)
{
cout << "Who is in seat "<< turn << " on " << day[time-1] <<"?"
<< endl;
cin >> seat[turn-1];
cout << "Seat " << turn << " on " << day[time-1] ": "
<< seat[turn-1]
<< endl;
a_file << "Seat " << turn << ": " << seat[turn-1] << "on day " << day[time-1] << endl;
}
}
So what's up?