About 10,500,000 results
Open links in new tab
  1. C++ code file extension? What is the difference between .cc and .cpp

    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 what you do, …

  2. What is the <=> ("spaceship", three-way comparison) operator in C++?

    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 an …

  3. c++ - What is the meaning of 'const' at the end of a member function ...

    When you add the const keyword to a method the this pointer will essentially become a pointer to const object, and you cannot therefore change any member data. (Unless you use mutable, more on that …

  4. 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 ...

  5. c++ - How do you create a static class? - Stack Overflow

    If you're looking for a way of applying the static keyword to a class, like you can in C# for example, then you won't be able to without using Managed C++. But the looks of your sample, you just need to …

  6. Using G++ to compile multiple .cpp and .h files - Stack Overflow

    There are also .h files that contain classes and their function definitions. Until now the program was compiled using the command g++ main.cpp. Now that I've separated the classes to .h and .cpp files …

  7. 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 some rapidly …

  8. How do I fix the error "was not declared in this scope"?

    This is similar to how one would write a prototype for functions in a header file and then define the functions in a .cpp file. A function prototype is a function without a body and lets the compiler know …

  9. c++ - What does the explicit keyword mean? - Stack Overflow

    33 Cpp Reference is always helpful!!! Details about explicit specifier can be found here. You may need to look at implicit conversions and copy-initialization too. Quick look The explicit specifier specifies …

  10. What is the meaning of the auto keyword? - Stack Overflow

    auto was a keyword that C++ "inherited" from C that had been there nearly forever, but virtually never used because there were only two possible conditions: either it wasn't allowed, or else it was …