About 11,200,000 results
Open links in new tab
  1. What is the <=> ("spaceship", three-way comparison) operator in …

    Nov 24, 2017 · This is called the three-way comparison operator. According to the P0515 paper proposal: There’s a new three-way comparison operator, <=>. The expression a <=> b returns …

  2. C++ code file extension? What is the difference between .cc and …

    95 .cpp is the recommended extension for C++ as far as I know. Some people even recommend using .hpp for C++ headers, just to differentiate from C. Although the compiler doesn't care …

  3. What does the C++ standard say about the size of int, long?

    I'm looking for detailed information regarding the size of basic C++ types. I know that it depends on the architecture (16 bits, 32 bits, 64 bits) and the compiler. But are there any standards for ...

  4. c++ - Compiling .cpp files with 'g++' - Stack Overflow

    Jul 25, 2021 · Compiling .cpp files with 'g++' Asked 4 years, 3 months ago Modified 2 years, 6 months ago Viewed 17k times

  5. What is the purpose of using #ifdef and #if in C++?

    The meaning of #ifdef is that the code inside the block will be included in the compilation only if the mentioned preprocessor macro is defined. Similarly, #if means that the block will be …

  6. Regular cast vs. static_cast vs. dynamic_cast - Stack Overflow

    Aug 26, 2008 · I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e. …

  7. Returning multiple values from a C++ function - Stack Overflow

    Aug 19, 2015 · Is there a preferred way to return multiple values from a C++ function? For example, imagine a function that divides two integers and returns both the quotient and the …

  8. Why are #ifndef and #define used in C++ header files?

    I have been seeing code like this usually in the start of header files: #ifndef HEADERFILE_H #define HEADERFILE_H And at the end of the file is #endif What is the purpose of this?

  9. How to use the PI constant in C++ - Stack Overflow

    Nov 13, 2009 · I want to use the PI constant and trigonometric functions in some C++ program. I get the trigonometric functions with include &lt;math.h&gt;. However, there doesn't seem to be …

  10. How can I convert int to string in C++? - Stack Overflow

    itoa will be faster than the stream equivalent. There are also ways of re-using the string buffer with the itoa method (avoiding heap allocations if you are frequently generating strings. e.g. for …