I'm new to C++ but im really excited about learning this new language. This is my first post on this forum but im really excited to be here. My problem is that as i've been making my first programs i've found that they're crashing for no particular reason! I made some little basic program to see if even that would work but it doesn't! I'm using the Bloodshed Dev C++ compiler. Heres my code.

Code:
#include <iostream>
#include <string>
using namespace std;
         
int main( void )

{
         cout << "Hello, what is your name?";
         string name;
         cin >> name;
         cout << "Hey" << name.c_str();
         return 0;
}
Please help, like i said im really new. Any feedback would be most appreciated. It asks me for my name but when i type it in and hit enter it just exits. Sorry if i'm looking really newb right now.