I 've linked the two files together, main.cpp and myClasses.h, I've declared a variable, but what I'm asking is can you access a variable from myClasses.h?
Here's a example of what I got so far:
//main.cpp
#include "myClasses.h"
#include <iostream>
using namespace std;
int main()
{
ClassOne myClass_instance;
s = 5;
cout << "The number is: " << s;
//etc....
}
//myClasses.h
// MyClasses.h
#ifndef MYCLASSES_H // note: these are very important!
#define MYCLASSES_H
class ClassOne
{
public:
int s;
};
#endif
The error i'm getting is something like : s undeclared.
Thanks for the help.