lundi 23 mars 2015

Comparing strings behaves different on mingw and on ubuntu gcc

I am trying to compare two strings. Here is the code that I have.



string line;
getline(cin, line);
if(line.compare("% Input alphabet")==0)
dosomething;


The problem is the following code works correctly when using mingw on a windows machine but when I run the same code on my ubuntu vm it does not execute dosomething method. I compiled my program and ran the following commands


On windows



a.exe < input.txt



On Ubuntu



./a.out < input.txt



Aucun commentaire:

Enregistrer un commentaire