Witam, mam problem z napisaniem konstruktora.
Plik header
#ifndef CBUDYNEK_H_INCLUDED
#define CBUDYNEK_H_INCLUDED
#include "Cbudynek.cpp"
#include <iostream>
#include <cstring>
using namespace std;
class Cbudynek
{
private:
int year;
double height;
char* name;
public:
Cbudynek();
};
#endif // CBUDYNEK_H_INCLUDED
Plik źrodłowy
#include "CBudynek.h"
#include <iostream>
#include <cstring>
using namespace std;
Cbudynek::Cbudynek() :year(1887) , height (342.7)
{
name = new char[ (strlen("Eiffla") ];
name = "Eiffla";
};
Błąd jaki się pojawia to:
||=== Build: Debug in Zadanie (compiler: GNU GCC Compiler) ===|
E:\Prace\C++\Lab2\Lab2 myOwn\Zadanie\Cbudynek.cpp|6|error: 'Cbudynek' does not name a type|
E:\Prace\C++\Lab2\Lab2 myOwn\Zadanie\Cbudynek.cpp||In constructor 'Cbudynek::Cbudynek()':|