Tuesday, March 9, 2010

CS Note

Wasn't big enough to gloat to my brother, or boast on my Facebook wall, so this here!

Felt great being able to write an overloaded insertion operator when it was not assigned in the program! I'm glad I'm learning new CS concepts that actually help me write better code. Anyway, this is what I had:

ofstream& operator<< (ofstream &ofs, vector &text)
{
for(vector::const_iterator itr = text.begin(); itr != text.end(); itr++)
ofs << *itr;

return ofs;
} // operator<<


:) *proud*

1 comment:

Grey said...

Wow, nerdiest post I have ever read on the internet. It's all good though haha. I do the same thing except I gloat to other people as well :D