i have a .txt file which contains line of string like the below format
|111|34 sdddd| ppppp| A/C| 32| sadfd|
|4324|23 mmm| yyyyy| A/C|32| fdfffdfd|
the sixth column is the no of seats column where when i check the status of that particulat bus no 4324 it is displaying that the "seat is not available" and "available seats are 0"
In this code snippet i
i face...
User Profile
Collapse
-
please help which checking no of seats in the flat file ".txt"
-
yeah
i have did but again error.
declared a function to get bus no
public:
void get_bus_no()
{
cout<<bus_no;
}
while getting the bus_no i used a temporary variable busno converting it into string , assignin it to bus_no and declared bus_no as string in private.
cout<<"Enter Bus_No::";
cin>>busno;... -
-
i though calling a private variable of a class using object would throw an error so called the member variable through a public function....Leave a comment:
-
diclared bus_no in the class as string and in public scope.
and still getting error on this line.
if(strcmp(obj2[n].bus_no,obj.bus _no)==0)
as
newadd1.cpp:102 : error: cannot convert âstd::stringâ to âconst char*â for argument â1â to âint strcmp(const char*, const char*)â...Leave a comment:
-
Syntax Error comparing private class data
how can i compare the a private variable of a class and a value in the column of a text file.
there is a syntax error in my code while comparing. senario is i am getting bus details like busno, source , destination,typ e of bus, price/head . I should compare the busno which i get through object to the bus no which is present in a .txt file. and contents in the text file is as...Leave a comment:
-
Syntax Error comparing private class data
how can i compare the a private variable of a class and a value in the column of a text file.
there is a syntax error in my code while comparing. senario is i am getting bus details like busno, source , destination,typ e of bus, price/head . I should compare the busno which i get through object to the bus no which is present in a .txt file. and contents in the text file is as the format below.
|1488|xxx|uuuu| A/c|150.
|1422|mmm|oooo| nonA/C|900.... -
gettin a number and comparing if found shld replace with new record
hai all,
i am able to get only single char from a ordinary text file but i want to get each first coloumn compare with given number if matching should be able to replace the entire record or row . how to use the buffer?. Please help me got to finish my project within two days.
No activity results to display
Show More
Leave a comment: