Help me to fix the syntax error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Help me to fix the syntax error

How can I fix the syntax error in the function show reservation https://code.sololearn.com/cQI2d4m22118/?ref=app

23rd Feb 2020, 12:03 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
37 Answers
+ 11
At least post your code
23rd Feb 2020, 12:06 PM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 4
Taste,HonFu and Lealyn Rose Froilan I apologize for my inappropriate answers.And i'm deleting it.
23rd Feb 2020, 1:19 PM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 2
input seat no 12 out put 1-32 seats are empty
23rd Feb 2020, 2:08 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 2
user input didn't accept on reservation
23rd Feb 2020, 2:08 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 2
I think i my mistake is the syntax can i help me
23rd Feb 2020, 2:08 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 2
Fixed the code just have a look. 1. reservation row, col convertion. 2. insert getline removed. 3. show removed the if check. https://code.sololearn.com/cItj4iNcpI7X/?ref=app
23rd Feb 2020, 6:59 PM
naresh
naresh - avatar
+ 1
Those who are master in c++ language pls help me
23rd Feb 2020, 12:07 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
I think i have a problem with my syntax
23rd Feb 2020, 12:23 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
23rd Feb 2020, 1:02 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
Hope u can help me on the reservation
23rd Feb 2020, 1:02 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
anyone?
23rd Feb 2020, 2:02 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
Can you Show us example for input and expected output?
23rd Feb 2020, 2:05 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar
+ 1
Anyone who is master in c++ language?? Can u help me on my syntax
24th Feb 2020, 5:56 AM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
The reservation Has a problem on the syntax
24th Feb 2020, 9:44 AM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
when u run that program there is a syntax error in the function of show reservation
24th Feb 2020, 4:24 PM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
check this normally in c standard the string compare strcmp will be taking chat * pointer; strcmp (const char* str1, const char* str2); In the above program I have observed If (strcmp(bus[n].busn, number) ==0) In this line bus[n].busn which is string and number is a array of char. Change the above peace of code with if (strcmp(bus[n].busn.c_str(), number) ==0)
24th Feb 2020, 4:39 PM
naresh
naresh - avatar
+ 1
DeWill hope u help me
25th Feb 2020, 3:01 AM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
User 0110 yes it's workinh but it has an syntax error in the show reservation.
25th Feb 2020, 9:25 AM
Lealyn Rose Froilan
Lealyn Rose Froilan - avatar
+ 1
I run the code, it show no error. I noticed that you created a function that you called empty, in order to make the bus seats Empty, but when user choose the install function multiple times, the function empty() works only on the first bus , while the rest of the buses when calling the install function again will always be not empty(cout --> akways seats not emty). If it was intentional, there is nothing wrong. As for if it was not intentional, then you should move the call of emty() function to line 178 after 'w' input inside the while loop, thats will make evry seat buses emty after call istalation() function sevral time.
25th Feb 2020, 8:05 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar
0
Welcome, Lealyn. 🙂 This forum is meant for specific programming-related questions. Do you have a specific code of your own you need help with right now? Then please ask, and link your code here. https://www.sololearn.com/discuss/1316935/?ref=app
23rd Feb 2020, 12:06 PM
HonFu
HonFu - avatar