I wrote a program in C ++. At first I wrote this normally (usually I do not write in C ++), and I wanted to put the variables in the header and code in the .cpp file. The problem is that the class in .cpp does not see variales - "Identifier undefined".
hijras
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
class Hex {
private:
int n;
string value;
bool negative = false;
public:
Hex();
bool isCorrect();
string getValue();
void setValue();
};
a.cpp
#include "a.h"
#include "stdafx.h"
class Hex {
public:
Hex(int n, string w) {
}
What am I doing wrong? If this is important, I am working on VS 2013.
source
share