I want to write a simple program to check class and inheritance in Code Blocks but i don't know how to write. I have make new project and add new class named "Car".
This is main class.
#include <iostream>
#include "Car.h"
using namespace std;
int main()
{
Car c;
return 0;
}
and this is include\Car.h file.
#ifndef CAR_H
#define CAR_H
class Car
{
public:
Car();
};
#endif // CAR_H
and this is Car.cpp file code.
#include <iostream>
#include "Car.h"
using namespace std;
Car::Car()
{
cout << "Car program." <<endl;
}
But when i compile and run it, it gives me errors. Please tell me how to resolve this and how to use code blocks.