Created
March 13, 2013 21:36
-
-
Save marcosscriven/5156546 to your computer and use it in GitHub Desktop.
Test case for Emscripten. In native code this will continue on to next line, but in Javascript, it runs forever with the given input.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A | |
1 | |
B | |
C | |
3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
int main() { | |
std::string filename = "processfile.txt"; | |
std::cout << "Processing file:" << filename << "\n"; | |
std::ifstream stream(filename.c_str()); | |
while (!stream.eof()) | |
{ | |
std::string key, value; | |
std::getline(stream, key); | |
std::getline(stream, value); | |
std::cout << "Read:" << key << ", with value:" << value << "\n"; | |
if(value.length() == 0) { | |
std::cout << "Got a blank value" << "\n"; | |
continue; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment