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.

Programm nochmals starten ???

Empfohlene Antworten

Veröffentlicht

Hi Leutz....

wir fangen gerade mit c++ an und ich hab nu schonma nen kleines prob...

wie kann ich eine einfache abfrage gestalten, in der man auswählen kann ob

das programm nochmals durchlaufen werden soll oder nicht ??

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

// Autor AD

#include <iostream>

#include <conio>

void positiv()

{

cout<<endl<<" Das Programm soll nochmal starten ";

getch();

}

void negativ()

{

cout<<endl<<" Das Programm soll beendet werden ";

getch();

}

int main()

{

int zahl;

cout<<endl<<"Wollen Sie das Programm nochmals starten =?= ";

cout<<endl<<" 1 Ja, sehr gerne ! 2 Nein, muss nich sein ! ";

cin >> zahl;

switch (zahl)

{

case 1:

positiv();

case 2:

negativ();

}

// return 0;

getch();

}

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

so in etwa soll es in meiner vorstellung aussehen.... es funktioniert auch...

nur weiß ich nich wie ich nun aus der positiv funktion wieder zurück in die

main funktion komme.....

HELP *gg*

bin auch für andere lösungen offen......

:mod: Cr4sH

@ GT der mächtige Pirat :uli

deine lösung gefällt mir viel besser..

habs sie mir gleich in meinem übungsheftchen notiert...

ThX :D

bis demnächst

Cr4sH

Originally posted by Guybrush Threepwood

Ok;)


do
{
int zahl;
cout<<endl<<"Wollen Sie das Programm nochmals starten =?= ";
cout<<endl<<" 1 Ja, sehr gerne ! 2 Nein, muss nich sein ! ";
cin >> zahl;
}
while(zahl == 1);
[/PHP]

nur muss `zahl' ausserhalb der Schleife deklariert werden.

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.