initializing values for arrays, and chaging them w/o using scanf
hey guys!! just discovered this site! It's great! went over the threads..very helpful to guys like us..:)
anyway, i got this program that needs to simulate a simple airline seat reservation. I can initialize values for my text arrays but cant modify or change them without using scanf(). Thanks!!
-----------------------------------------
#include <conio.h>
#include <stdio.h>
char a[7][7]={"A","A","A","A","A","A","A"},b[7][7]={"B","B","B","B","B","B","B",},c[7][7]={"C","C","C","C","C","C","C"},d[7][7]={"D","D","D","D","D","D","D",};
int x;char y;
main()
{
do{
clrscr();
printf("\n1\t%s\t%s\t%s\t%s\n\n",a[0],b[0],c[0],d[0]);
printf("2\t%s\t%s\t%s\t%s\n\n",a[1],b[1],c[1],d[1]);
printf("3\t%s\t%s\t%s\t%s\n\n",a[2],b[2],c[2],d[2]);
printf("4\t%s\t%s\t%s\t%s\n\n",a[3],b[3],c[3],d[3]);
printf("5\t%s\t%s\t%s\t%s\n\n",a[4],b[4],c[4],d[4]);
printf("6\t%s\t%s\t%s\t%s\n\n",a[5],b[5],c[5],d[5]);
printf("7\t%s\t%s\t%s\t%s\n\n",a[6],b[6],c[6],d[6]);
printf("Column Number : ");
scanf("%d",&x);
printf("Enter Column Letter : ");
scanf("%s",y);
if(y=='a')
a[x][x]='X';
getch();
}while(x!=100);
}