3 Solved Topics
Remove Filter Hey. What's better, i++ or ++i? Well ++i returns the value after it's incremented, but which is faster? (not necessarily for int, user-defined types with operator++ overloaded too.) | |
If you use the new operator on a class, say [code=c++]class dummy { public: string f; }; int main(int argc, char *argv[]) { dummy *p = new dummy; return 0; }[/code] do you have to use the delete operator on [icode]p[/icode]? (since, apparently, it utilizes new.) | |
I know the & operator means address-of, but what's it do when in a function prototype? Example: [code=c++]void foo(std::string& str)[/code] or [code=c++]void foo(char& c)[/code] what's the & for in that? |
The End.