0

Hey i'm pretty new to coding and I can't seem to get a very basic string program to work. Here is my code:

# #include <string> 
# #include <iostream>

using namespace std;

int main() {
string name;
cin >> name;
string message("hi");
cout << name << message;
return 0;
}

This is a very generic example but whenever I run it in NetBeans 8.1 it will build but not run and give me this:

Process is started in an external terminal ...

RUN FAILED (exit value 127, total time: 352ms)

Any other file I run will work as long as it does not contain a string command. I figure it must be something with the settings in NetBeans. I've tried using std:: etc etc but it doesn't fix the problem. Any tips/advice would be much appreciated!

Misa Lazovic
  • 2,805
  • 10
  • 32
  • 38

1 Answers1

0

You should change the include statements to have only one # symbol preceding them.

#include <string> 
#include <iostream>

This would hopefully fix your error; the rest of the code seems fine.

Anindya Dutta
  • 1,972
  • 2
  • 18
  • 33