I have a loop while that will only end when the value 0 (zero) is entered. I have a variable that will receive a command option. Within the loop I have a switch case where:
0) exits the program (returns to while and ends);...
I need to write data to the Windows registry in my application.
How to work with Windows registry data manipulation using C ++?
What is the correct way to write new data to the registry without errors?
I was responding to a std :: stack implementation problem. It was easy, but I could not use my first idea: std :: vector (it replaced forever the dynamic pointers). My code is:
template <class T> class stack
{
T* data;
unsigned s...
I have the following code: A derived template calling a function from a base also template.
template <int M>
struct Base { void foo() {} };
template <int M>
struct Derived : public Base<M> {
void bar() { foo(); }
};
B...
I'm "programming in C" but compiling using the .cpp extension and g ++ to have some facilities. My goal is to do a program that receives a starting salary and calculates the final salary according to a certain bonus. The bonus is given in...
I'm wanting to make a screen recorder. What I thought of doing was this:
From the recording event hit 30 screenshots per second and then join them in sequence to form a video.
At this point some doubts arise:
Is this the right way to think a...
In C ++ there are several ways to create a constructor and instantiate an object. But there are so many ways I'm confused by the difference of each one.
Assuming I have the following class:
using namespace std;
class Carro
{
private:...
#include <iostream>
using namespace std;
int main()
{
int nombre, carre ;
cout << "Introduza un numero : " ;
cin >> nombre ;
carre = nombre * nombre ;
cout << "A raiz quadrada est ; " << carre ;
}
When c...
In this answer bigown said that if the frame member was a pointer you do not need to copy the string into it. But arrays are not pointers? Why is it different?
My question is regarding the following snippet of code:
#include <stdio.h>
int main(void){
int teste = 0, x0 = 0, x1 = 0, x2;
x2 = 1;
teste = ((x0|x2) | (x1|x2) << 1);
printf("Valor de teste: %d ", tes...