|
|
|||||
|
Get the Ebook
C Tutorial
Source Code
Function Reference
|
Never do unary minus on sizeofThis tip submitted by Vaibhav on 2006-01-15 02:13:54. It has been viewed 14521 times.Rating of 7.0 with 121 votes What will be output of cout<<-sizeof(char); No, it's not -1, it is 4294967295! The return type of sizeof is size_t (similar to unsigned int). If you try to use -sizeof() you can now understand what will happen. Once I used it in seekg() function and spent nearly 6 hours debugging it before I finally spotted it. More tips Help your fellow programmers! Add a tip!
Want to become a C++ programmer? The Cprogramming.com ebook, Jumping into C++, will walk you through it, step-by-step. Get Jumping into C++ today!
Popular pages
Custom Search
|
||||