Skip to content

Instantly share code, notes, and snippets.

@gzmask
Created May 31, 2011 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gzmask/1001404 to your computer and use it in GitHub Desktop.
Save gzmask/1001404 to your computer and use it in GitHub Desktop.
crash without warning
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main() {
string xbn_filename;
string line_str;
string block_str;
//this is the code block that reads the ???.xbn file
xbn_filename = "input.xbn";
ifstream xbn_file (xbn_filename.c_str());
if (xbn_file.is_open()) {
while (!xbn_file.eof()) {
getline(xbn_file, line_str);
//cout<<line_str<<endl;
//block_str.append(line_str);
//block_str.append("\n");
}
//cout<<block_str<<endl;
xbn_file.close();
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment