c++ Programming Glossary: input_line
Why is reading lines from stdin much slower in C++ than Python? http://stackoverflow.com/questions/9371238/why-is-reading-lines-from-stdin-much-slower-in-c-than-python #include time.h using namespace std int main string input_line long line_count 0 time_t start time NULL int sec int lps .. start time NULL int sec int lps while cin getline cin input_line if cin.eof line_count sec int time NULL start cerr Saw line_count.. Here are the pertinent lines for my fellow noobs char input_line MAX_LINE char result snip while result fgets input_line MAX_LINE..
Why is splitting a string slower in C++ than Python? http://stackoverflow.com/questions/9378500/why-is-splitting-a-string-slower-in-c-than-python tokens.push_back item add token to vector int main string input_line vector string spline long count 0 int sec lps time_t start time.. false disable synchronous IO while cin getline cin input_line spline.clear empty the vector for the next line to parse I'm.. implementations per compilation obviously split1 spline input_line split2 spline input_line count count subtract for final over..
|