mirror of
https://github.com/lucaspalomodevelop/cpp_stuff.git
synced 2026-03-12 22:47:22 +00:00
resolved 'previous definition' in 'classes'
This commit is contained in:
parent
13077375ff
commit
e254149b8d
@ -1,12 +1,14 @@
|
||||
// #include "tier.cpp"
|
||||
#ifndef TIER_H // ensuring that this object is only initialized once
|
||||
#include "tier.cpp"
|
||||
#endif
|
||||
|
||||
class hund : public tier
|
||||
{
|
||||
public:
|
||||
hund();
|
||||
public:
|
||||
hund();
|
||||
};
|
||||
|
||||
hund::hund() : tier()
|
||||
{
|
||||
Laut = "wuff";
|
||||
Laut = "wuff";
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
// #include "tier.cpp"
|
||||
#ifndef TIER_H //ensuring that this object is only initialized once
|
||||
#include "tier.cpp"
|
||||
#endif
|
||||
|
||||
class katze : public tier
|
||||
{
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#include "tier.cpp"
|
||||
#include "hund.cpp"
|
||||
#include "katze.cpp"
|
||||
#include <stdio.h>
|
||||
|
||||
BIN
classes/program
BIN
classes/program
Binary file not shown.
@ -1,22 +1,28 @@
|
||||
#include<stdio.h>
|
||||
#ifndef TIER_H
|
||||
#define TIER_H
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include "tier.h"
|
||||
|
||||
class tier{
|
||||
public:
|
||||
tier();
|
||||
// class tier
|
||||
// {
|
||||
// public:
|
||||
// tier();
|
||||
|
||||
std::string getLaut();
|
||||
protected:
|
||||
std::string Laut;
|
||||
};
|
||||
// std::string getLaut();
|
||||
|
||||
tier::tier() {
|
||||
this->Laut = "void";
|
||||
// protected:
|
||||
// std::string Laut;
|
||||
// };
|
||||
|
||||
}
|
||||
tier::tier()
|
||||
{
|
||||
this->Laut = "void";
|
||||
}
|
||||
|
||||
std::string tier::getLaut()
|
||||
{
|
||||
|
||||
return this->Laut;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
11
classes/tier.h
Normal file
11
classes/tier.h
Normal file
@ -0,0 +1,11 @@
|
||||
#include<stdio.h>
|
||||
#include <string>
|
||||
|
||||
class tier{
|
||||
public:
|
||||
tier();
|
||||
|
||||
std::string getLaut();
|
||||
protected:
|
||||
std::string Laut;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user