Few typos in code

Few typos in code


while rearranging the given code, I detected (rather g++ did) a few typos in it: the last argument "ofstream& output" is missing in the signature of print_flight, print_flights and print_travel.

So, to match the declarations of the functions, the signatures should be:

void print_flight  (Flight& flight, ofstream& output);
void print_flights (vector<Flight>& flights, ofstream& output);
void print_travel (Travel& travel, vector<vector<string>>& alliances, ofstream& output);

instead of:

void print_flight  (Flight& flight);
void print_flights (vector<Flight>& flights);
void print_travel (Travel& travel, vector<vector<string>>& alliances);

Or simply ostream and not ofstream if you want to have the possibility to print in cout as well.

In the hope that it will help someone :)

publicaciones de 4 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de eviltosha

And some typos that don't affect compiler, but look rather funny:
- in Flight structure: discout instead of discount
- function nerver_traveled_to() instead of never_traveled_to()
- in time functions: seconde instead of second

Imagen de Heye (aka. slevin7)

Yeah, at first I didn't notice the "discout" because of the auto completion of my IDE. But at some point I was going nuts asking myself why the compiler said that "discount" is not a member of Flight... One of the bad things about IDEs ^^

Rock the bits!
Imagen de Dusan V.

Also, in newinput3 script shuld be:
time ./run -nb_threads 6 -from LONDON\ HEATHROW -to NEW\ YORK\ JOHN\ F.\ KENNEDY -depart...
instead of
time ./run -nb_threads 6 -from LONDON\ HEATHROW -to NEW\ YORK\ JOHN\ F\.\ KENNEDY -depart...

Inicie sesión para dejar un comentario.