About 10,100,000 results
Open links in new tab
  1. 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 …

  2. What is the C++ function to raise a number to a power?

    In C++ the "^" operator is a bitwise XOR. It does not work for raising to a power. The x << n is a left shift of the binary number which is the same as multiplying x by 2 n number of times and …

  3. 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?

  4. Iterate through a C++ Vector using a 'for' loop - Stack Overflow

    Oct 3, 2012 · I am new to the C++ language. I have been starting to use vectors, and have noticed that in all of the code I see to iterate though a vector via indices, the first parameter of …

  5. Run C++ in command prompt - Windows - Stack Overflow

    Syntax is just gcc my_source_code.cpp, or gcc -o my_executable.exe my_source_code.cpp. It gets more complicated, of course, when you have multiple source files (as in implementation; …

  6. How do you add a timed delay to a C++ program? - Stack Overflow

    Sep 12, 2014 · I am trying to add a timed delay in a C++ program, and was wondering if anyone has any suggestions on what I can try or information I can look at? I wish I had more details on …

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

  8. c++ - What is the difference between public, private, and …

    Mar 19, 2015 · Only members/friends of a class can see private inheritance, and only members/friends and derived classes can see protected inheritance. public inheritance IS-A …

  9. Can we have functions inside functions in C++? - Stack Overflow

    Dec 1, 2010 · He's talking about nested functions. Similarly to being able to next classes inside classes, he wants to nest a function inside a function. Actually, I've had situations where I …

  10. Proper way to initialize C++ structs - Stack Overflow

    Jan 21, 2017 · Our code involves a POD (Plain Old Datastructure) struct (it is a basic c++ struct that has other structs and POD variables in it that needs to get initialized in the beginning.) …