C++ 프로그램을 실행할 수 없습니다. No se ejecuta el programa (C++ i can't run a program. No se ejecuta el programa)


문제 설명

C++ 프로그램을 실행할 수 없습니다. No se ejecuta el programa (C++ i can't run a program. No se ejecuta el programa)

제 문제는 매우 간단합니다. C++에서 프로그램을 실행할 수 없습니다. "Hello World!"와 같은 간단한 프로그램은 잘 컴파일되지만 실행하고 싶을 때 콘솔의 검은 화면만 나타나게 하면 됩니다.

편집 내 시스템은 Windows 7(64비트)입니다. )

Visual Studio 2013, QtCreator 및 NetBeans 8.0.2에서 시도했지만 문제는 동일하지만 발견했습니다. 이전 프로젝트(이전에 수행하고 잘 실행한 코드 ) 여전히 잘 실행되지만 새 프로젝트만 실행할 수 없습니다.

편집:

#include <iostream>

using namespace std;

int main()
{

cout << "HOLA  MUNDO" << endl;
return 0;

}

참조 솔루션

방법 1:

This is normal. It happens if you run your program 'inside' Visual Studio IDE:

  • a console window is opened;

  • your program is ran;

  • the console window is closed.

Your program runs fine, only the above happens too fast.

There are three solutions I can think of:

  1. If you are in debug mode, place a breakpoint (F9, usually) at last line and launch the program (F5). Once the breakpoint is reached, switch to console window, then back to IDE and press F5 to end the program.
  2. Run your program in a console window (START+R, CMD, ENTER).
  3. Change your code: add cin.ignore(); before return 0;. The program will wait for you to enter something before it ends.

(by Alejoozdf)

참조 문서

  1. C++ i can't run a program. No se ejecuta el programa (CC BY‑SA 2.5/3.0/4.0)

#C++






관련 질문

파일의 암호화/복호화? (Encryption/ Decryption of a file?)

이상한 범위 확인 연산자가 있는 C++ typedef (C++ typedef with strange scope resolution operator)

개체 배열 매개변수--오류: '문자' 필드에 불완전한 유형이 있습니다. (Object array parameter--error: field ‘letters’ has incomplete type)

C++에서 메모리 삭제 (Deleting memory in c++)

C++ 프로그램을 실행할 수 없습니다. No se ejecuta el programa (C++ i can't run a program. No se ejecuta el programa)

컴파일 시 변수의 이름과 수명 (Name and lifetime of variables at compile time)

control-c 후 Visual Studio 콘솔 프로그램 충돌 (visual studio console program crashes after control-c)

멤버 변수에 std::enable_if 또는 유사한 메서드 사용 (Using std::enable_if or similar method on member variable)

ifstream input_file(filename); (I am receiving an error "no matching function to call" in the line ifstream input_file(filename);)

ESP8266에서 잠시 실행하면 JsonData 크기가 0이 됩니다. (JsonData size becomes zero after awhile of running in ESP8266)

합에 대한 속도 문제(제수의 합) (Speed problem for summation (sum of divisors))

벡터 벡터에서 하위 벡터의 첫 번째 값을 찾기 위해 begin() 및 end() 반복기의 범위를 지정하는 방법은 무엇입니까? (How to specify a range for begin() and end() iterators to find first value of sub vector in a vector of vectors?)







코멘트