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.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe keine Ahnung von C++ und trotzdem solls ich ein nettes Programm entwerfen, na egal, jedenfalls hab ich jetzt solange dran rumgebastelt bis ich vor dem unten stehenden Problem stehe.

Ich habe zwei Strukturen ZUSTAND und EREIGNIS, die wie folg miteinander verknüpft werden sollten. Also bei einem ZUSTAND können mehrere EREIGNISSE eintreten, die dann wiederum zu einem ZUSTAND führen. Hab mir also gedacht ich pack alles in ne Liste und verkette das ganz dann schön. Nur leider kann ich keinen Pointer auf den Knoten ZUSTAND im Struct EREIGNIS setzen, da er den Struct ZUSTAND ja noch gar nicht kennt ????????

typedef struct ereignis {

string name;

zustand *next; <<<<<<<<<<<< Diese Zeile mag er nicht

ereignis* nochereignis;

} EREIGNIS;

typedef struce;

zustand *net zustand {

string namxt;

ereignis* ereignisliste;

} ZUSTAND;

Also ich glaub das war jetzt mehr als verwirrend, aber ich hoffe auf eure Hilfe.

Vielen Dank im Voraus.

Jens

Du brauchst eine sogenannte Forward-Declaration. Schreib einfach vor die Deklaration von ereignis:

struct zustand;

Das sagt dem Compiler, dass irgendwann später mal eine Struktur zustand definiert wird. Solange nur Zeiger und Referenzen verwendet werden, ist er damit erst mal zufrieden.

DANKE !!!! Dachte mirschon, dass die Lösung ziemlich simpel ist, aber wenn man sie nicht kennt. Danke nochmal.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.