Hi Group,
When i compile the following program it compiles successfully, but
crashes while executing. I am trying to assign a NULL char pointer to a
string. The error message is
/home1/murugan/prog/ccprog >./a.out
Abort(coredump)
/home1/murugan/prog/ccprog >
The program is :
#include <iostream>
#include <string>
using namespace std;
int main()
{
string request;
char* str = 0;
request = str;
cout<<endl<<req uest<<endl;
return 1;
}
Thanks in advance.
Cheers
Shan
When i compile the following program it compiles successfully, but
crashes while executing. I am trying to assign a NULL char pointer to a
string. The error message is
/home1/murugan/prog/ccprog >./a.out
Abort(coredump)
/home1/murugan/prog/ccprog >
The program is :
#include <iostream>
#include <string>
using namespace std;
int main()
{
string request;
char* str = 0;
request = str;
cout<<endl<<req uest<<endl;
return 1;
}
Thanks in advance.
Cheers
Shan
Comment