• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


27 Feb, 2025

Updated at 21 Mar, 2025

The "cout" command does not display the message I want on the screen

I'm using VScode on Windows to program in C++.

The printf command works, but the cout command doesn't work. The compiler doesn't show me an error, either. I've already installed all of the necessary extensions in addition to MSYS2.

This is the code where I use the printf command that works correctly:

#include
#include

int main()
{
    printf("hola \n");
    system("pause");
    return 0;
} 

image

And this is the code where I use cout, where it does not show me the message "Hello", but instead shows me the following:

The terminal process [path\to\executable] terminated with exit code: -1073741515.

#include
#include
#include

using namespace std;

int main()
{
    cout<<"hola \n";
    system("pause");
    return 0;
} 

image

I tried reinstalling VSCode, along with the extensions, in addition to msys2.