String not displayed using cout

I am using CodeBlocks to run this simple code but when I run it the output window generates an error (aaa.exe has stopped working). aaa is the file name.
What is problem in displaying string using cout?

1
2
3
4
5
6
7
8
#include<iostream>
#include<string>
using namespace std;
int main(){
string a="abc";
cout<<a<<endl;
return 0;
}
There should not be a problem.
Have you re-compiled after making changes to the code (menu => Build => Build & Run)?
its can be run
Yes I am checking many cases since yesterday. Problem is with strings. Everything else is working perfectly like loops, functions, arrays, structures but when I use cout for string, it always generates this error. Any specific setting in CodeBlocks for string??
Is there any plugin or something like that for strings in Code::Blocks?
I am using Borland 5.5 + sp1,sp2.
Is there any problem in it?
Topic archived. No new replies allowed.