Answer the question
In order to leave comments, you need to log in
Is it possible to create an additional console window in c++?
Yesterday I started trying to do something in C++, and I have a question, is it possible to open a new one immediately after closing the console?
so that after the "CORRECT PASSWORD" a new one opens, here is the code
#include <iostream>
#include <time.h>
#include <dos.h>
#include <ctime>
#include <windows.h>
#include <process.h>
using namespace std;
int main(int argc, const char * argv[]) {
int num1, result;
setlocale(LC_ALL, "Russian");
printf("MB приветствует вас!/Magic Bullet! WELCOME YOU!\n");
Sleep(3000);
cout << "Введи свой ключ, пожалуйста/Enter your key, pls! :)\n" << endl;
cout << "Ваш ответ:/your answer" << endl;
cin >> num1;
result = num1;
if (result < 33102) {
setlocale(LC_ALL, "Russian");
cout << "ТЫ ЧЕ ШАВКА, ИДИ КЛЮЧ КУПИ, ОБСОС!/WHAT ARE YOU MUCH, GO BUY THE KEY, OBSOX!" << endl;
Sleep(5000);
exit(0);
}
if (result > 33102) {
Sleep(5000);
setlocale(LC_ALL, "Russian");
cout << "ТЫ ЧЕ ШАВКА, ИДИ КЛЮЧ КУПИ, ОБСОС/WHAT ARE YOU MUCH, GO BUY THE KEY, OBSOX!" << endl;
Sleep(2000);
exit(0);
}
if (result == 33102) {
Sleep(5000);
printf("Спасибо за покупку Magic Bullet!/Thankee you for buy Magic Bullet!");
Sleep(5000);
CreateWindow:
BOOL CreateProcess(CREATE_NEW_CONSOLE);
FreeConsole();
cout << "its seconds console";
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question