i have problem only declaring struct variable. i declare a struct in struct.h file and i wan main.c and class.h also using the same variable. But the class.h file say the struct is undeclare..
example:
struct.h
struct car{
int year;};
main.c
#include <cstdlib>
#include <iostream>
#include "struct.h"
#include "class.h"
using namespace std;
int main(int argc, char *argv[])
{
car c;
system("PAUSE");
return EXIT_SUCCESS;
}
}
class.h
#include <cstdlib>
#include <iostream>
using namespace std;
extern car c;
class test{
c.year=10;};