hello and good morning everyone! im new to c++ and just learnt the header files. I already tried many times to fix the error but when i include the header file in my main, i received an error " undefined reference to `IPhone::IPhone()'". Here is my header file. (im using DEV C++)
#ifndef IPHONE_H
#define IPHONE_H
class IPhone
{
public :
IPhone();
};
#endif
This is my cpp file (for the implementation of the header file)
#include "iphone.h"
#include<iostream>
using namespace std;
IPhone::IPhone()
{
cout<< "object created ";
}
Lastly, this is may main to test the class
#include<iostream>
#include "iphone.h"
using namespace std;
int main()
{
IPhone phone1;
return 0;
}
Thankyou in advance!