help me help me!!
Printable View
T.T
help pls
Please, read the Announcement: Before you post.... carefully and try to follow this politics.
Welcome :wave::wave::wave:
Many people use English as a second (or even third) language. This is an additional reason to set up your profile [Private Messaging, Location, Info]. All of this is covered in the link that you have already been given.
In case you do not know...FAQ means Frequently Asked Questions. These are pieces of information that have already been asked, and answered hundreds or thousands of time.
It is much more efficient to spend the time reading them, than it is to continually post the same information.
The problem is NOT your English but HOW you are using English in your posts...
Well, what I meant was (it is from "Announcements: Before you post.... "):
Quote:
Your subject line will impact how well your question is answered. Your subject line should indicate the topic you are asking or commenting about. Here are some suggestions:
- Be concise.
- If you can do it in just a few words, ask a question or state the topic of your question.
- If you cannot state your question or comment in just a few words, then type the topic of your question or comment as the subject line
- Don't simply say "help". It is assumed that if you ask a question, you want help.
- If your subject line isn't concise or doesn't indicate a specific topic, many people will skip your posting.
Your Posting
Just as important to your subject line is the posting or question itself.
- Be concise, however...
- Make sure you ask a question if you want an answer.
- Make sure your provide enough details. For example, if you ask a database question, it might be necessary to include the database you are accessing.
- Make sure your question fits within the category you are posting. Posting a Visual Basic question in the Visual C++ forum will result in a lower chance for an answer.
- Use real grammer. If you use things like "u r gr8", you are going to be seen as unprofessional. Worse, many of the people who speak English as a second language may not understand what you are saying -- and thus won't be able to response.
- If you want to make a personal response back to someone, use private messages instead of responding in the public forum. Private Messages can be sent with the PM button.
ok i try now!!
question:
now is this part make me blur:what i need to write in <if>the code that can let me check still got how many empty place in my cust array??
Code:
for(row=0;row<sizeR;row++){
for(col=0;col<sizeC;col++){
if(0==ID[row][col]){
flag=1;
break;
}
else{
printf("Not enough seats available!The flight is fully booked!");
can?
question:
now is this part make me blur:what i need to write in <if>the code that can let me check still got how many empty place in my cust array??
Code:
Code:
for(row=0;row<sizeR;row++){
for(col=0;col<sizeC;col++){
if(0==ID[row][col]){
for(j=0;j<i;j++){
printf("Enter your name");
scanf("%[\n]c",cust[sizeR][sizeC].name);
}
else{
printf("Not enough seats available!The flight is fully booked!");
how?
Please, get back to the link "Announcements: Before you post.... " and read carefully about using code tags. :(
as CPUWizard ( and more people ) already said....
* Join the fight, refuse to respond to posts that contain code outside oftags.Code:...
that means.... put your code between [ code ] and [ / code ] tags.
void Booking(void)
{
strcpy(cust[sizeR][sizeC].flightNo,"AK65");
strcpy(cust[sizeR][sizeC].date,"25-12-2008");
strcpy(cust[sizeR][sizeC].time,"23:45");
strcpy(cust[sizeR][sizeC].gate,"G9");
int ID[4][5]={
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0}
};
int con;
int id;
int i;
int j;
int row;
int col;
int flag=0;
printf("How many seat are you required:\n");
scanf("%d",&i);
int available_seats = 0;
for(row=0; row<sizeR; row++){
for(col=0; col<sizeC; col++){
if(cust[sizeR][sizeC].id == 0){
available_seats++;
}
}
}
if(available_seats >= i){
for(j=0;j<i;j++){
printf("\t\t\t--- KL Airline Booking Ticket ---\n");
cust[sizeR][sizeC].id=id;
id++;
printf("\t\t\tBooking ID\t:%d",&cust[sizeR][sizeC].id);
printf("\t\t\tFlight No.:");
scanf("%s",cust[sizeR][sizeC].flightNo);
fflush(stdin);
printf("\t\t\tPassenger:");
scanf("%[\n]s",cust[sizeR][sizeC].name);
fflush(stdin);
printf("\t\t\tDate:");
scanf("%s",cust[sizeR][sizeC].date);
fflush(stdin);
printf("\t\t\tTime:");
scanf("%s",cust[sizeR][sizeC].time);
fflush(stdin);
printf("\t\t\tGate:");
scanf("%s",cust[sizeR][sizeC].gate);
fflush(stdin);
printf("\t\t\tSeat No:");
scanf("%c",&cust[sizeR][sizeC].seatNo);
fflush(stdin);
i++;
system("pause");
system("cls");
/* printf("Want Countinue? press 1");
scanf("%d",&con);
if(con==1)
{
system("cls");
Booking();
}
else
{
system("cls");
menu();
}*/
}
}
else{
printf("Not enough seats available!");
}
why it keep looping??
which line wrong???
Which part of use code tags are you not understanding?