Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C++ Fehlermeldung Code::Block

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich fange grad mit der OOP in C++ an und bekomme gleich die ersten Fehlermeldungen :(:(:(

Mein QuellCode:

************************************************

#include <iostream>

using namespace std;

class Mensch {

public:

enum GEschlecht { MANN, FRAU };

private:

char name[30];

unsigned int alter;

bool geschlecht;

void test_geschlecht( void );

public:

void sehen( const char* objekt );

void hoeren( const char* gerausch );

void riechen( const char* geruch );

void schmecken( const char* geschmack );

void tasten( const char* objekt );

void erzeuge( const char* n= "Unbenannt",

unsigned int a = 0,

bool g = FRAU );

void print( void );

};

int main (void){

Mensch mann, frau, person, dummy;

Mensch* Menschptr;

mann.erzeuge( "Adam", 18, Mensch::MANN);

frau.erzeuge( "Eva" , 18, Mensch::FRAU);

}

*********** ENDE *********************************

FEHLERMELDUNG: undefined reference to Mensch::erzeuge(char const*, usigned int, bool)

Ich hoffe mir kann jemand weiter helfen :)

FEHLERMELDUNG: undefined reference to Mensch::erzeuge(char const*, usigned int, bool)

Das bedeutet einfach, dass du diese Methode nicht definiert hast. Vermutlich hast du bei der Definition einfach das Mensch:: vergessen.

Du solltest dich übrigens entscheiden, ob du bool oder den enum Mensch::GEschlecht benutzt. Dieser Mischmasch ist nicht so toll.

Vielen Vielen Dank für die schnellen Antworten :):):)

Ich werds gleich mal ausprobieren :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.