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 versuche mich gerade in das C etwas einzufuchsen vielleicht kann mir ja jemand helfen ich wollte erstmal was einfaches Probieren und zwar möchte ich das man zwischen 3 verschiede Menüs wählen kann ( A,B,C)

Bitte wählen sie zwischen a,b oder c

Wenn man aber nicht diese buchstaben wählt sollte es in einer schlefe enden das man wirklich nur die 3 wählen kann bzw 1 von den 3 wählen muss.

du bastelst einfach eine while-schleife

die wird dann so lange durchlaufen bis die richtige Eingabe kommt

sowas in der Art

int richtig = 0;

string mystring;

while (richtig != 1)

{

printf("gib ma wat ein");

scanf("%s", mystring);


if (mystring == "a" || mystring == "b" || mystring == c)

richtig = 1;

}

(ich hoffe die Syntax stimmt so ... reines C is schon ein paar Jahre her bei mir)

Wenn du sagst C, schliesst du dann C++ explizit aus?

Und wie soll die Eingabe erfolgen?

Soll sie mit der Eingabetaste bestätigt werden also etwa so:

"Geben sie A, B oder C ein: " -> Benutzer gibt a ein und drückt return

oder soll das ganze "live" passieren also etwa so:

"Geben sie A, B oder C ein: " -> Benutzer gibt a ein, Programm erkennt das sofort (ohne return) und macht weiter...

?

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.