Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

visual studio code terminal keeps closing c++

//add system("pause"); before return 0; in main()
#include <iostream>
int main()
{
  	std::cout << "Hello world!" << endl; //system("pause") dont make new line so you will need the endl
	system("pause");
  	return 0;
}
 
PREVIOUS NEXT
Tagged: #visual #studio #code #terminal #closing
ADD COMMENT
Topic
Name
1+1 =