well looks like there have been 4 different methods posted...
Perl, PHP, grep, and VB...
now go at it!
well looks like there have been 4 different methods posted...
Perl, PHP, grep, and VB...
now go at it!
hmmm, interesting that 4 non-C/C++ solutions were posted at the c-board.Originally Posted by DavidP
Solves that problem...Code:#include <iostream> #include <fstream> #include <vector> #include <string> int main ( void ) { std::ifstream load ( "sourcefile.cpp" ); std::vector < std::string > lines; std::string tempStr; while ( !load.eof() ) { getline(load, tempStr); lines.push_back(tempStr); } load.close(); std::ofstream save ( "sourcefile.cpp" ); for ( int k = 0; k < lines.size(); k++ ) { save << (k + 1) << "\t" << lines[k] << "\n"; } save.close(); return 0; }
Hmm.. does that tell you anything about the worthiness of C/C++?Originally Posted by Perspective
It's so pure that to be spoken in this thread would dishonor it - and the speaker?Originally Posted by ober
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
> Hmm.. does that tell you anything about the worthiness of C/C++?
It tells you that many people have a lot more tools in the toolbox than some one-dimensional being who swears 'x' is best for everything.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Salem is kickin'
(according to his reputation bars)
....
Meanwhile Prelude exudes kindness and good coding practice while Thantos apparently refers to himself as being special.
Just for the record I never rode ANY school buses!
>Just for the record I never rode ANY school buses!
You poor soul. I'm sorry you missed out on the adventure.