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 ein Problem mit einer c++ Konsolenanwendung:

Ich möchte im Programm einen Befehl benutzen um die DOS-Box in der das Programm läuft bei einer bestimmten Situation zu beenden und die Dosbox zu schliessen. Nun habe ich jedoch keine Ahnung wie das geht und welche bibliothek ich laden muss... bitte um Hilfe

Grüße Timo

also entweder, wie schon bereits gesagt, einfach mit exit() oder ggf. return().

wenn du jedoch die anwendung von der konsole aus gestartet hast, wird sich die konsole im regelfall nicht automatisch schliessen.

du koenntest theoretisch, um die konsole zu schliesse, von deinem programm aus ein unterprogramm starten, das ueber die windows api "exit" tippt und enter drueckt :D

is zwar umstaendlich, geht aber ^_^

hatte mir z.b. auch mal ein programm geschrieben, das alle paar sekunden eine bestimmte tastenkombination ausfuert. wenn ich den code noch finde werd ich ihn posten.

#include <stdlib.h>


void main()

{

    //dein Zeugs


    //schließt DOS-Fenster

    system("exit");

}

sollte so funzen... habs aber noch net probiert

Mulla, ich glaub das geht nicht. ich bin mir aber auch nicht ganz sicher. kanns leider auch nit ausprobieren, da ich kein windows hab :hells:

ich denke mal "exit" wird ausgefuert und dann bleibt er irgendwie haengen oder schmeisst ne fehlermeldung oder so *g*

Das funktioniert schon, es hat nur nicht den effekt das die Konsole geschlossen wird die mein C Programm ausführt.

Im Prinzip würde ich mir das so vorstellen das system eine neue Konsole für sich öffnet um den übergebenen Befehl auszuführen und mit "exit" wird diese halt einfach direkt wieder geschlossen.

jo, das wär logisch. und so ist es wohl auch.

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.