0
Hello, the following code is showing error on the right:
#include <iostream>
using namespace std;
class teste {
static int x;
public:
teste () {
x++;
}
} t1;
int main () {
return 0;
}
declare the variable Static int, and in the constructor method I increment +1, but the following error happens.
How to solve?
Note: In the book I’m reading the code is also like this.
Do not put code as image!
– NoobSaibot
Edited, sorry
– Lucas Bittencourt