M
mukundan.narayanan
cat mystring.cpp
#include <iostream>
#include <string>
using namespace std;
string mystring ("ABC");
int main()
{
cout <<"value of string is "<<mystring<<endl;
}
The above program when compiled using the vac 8 xlC ,c++ compiler does
not seem to initialise the global variable mystring. any clues on
whats happening? should some flags be included
$ xlC -o mystring mystring.cpp /usr/lib/libC.a
$ ./mystring
value of string is
$
The same program when compiled on a vac 7 xlC compiler works fine!
$xlC -o mystring mystring.cpp /usr/lib/libC.a
$ ./mystring
value of string is ABC
$
#include <iostream>
#include <string>
using namespace std;
string mystring ("ABC");
int main()
{
cout <<"value of string is "<<mystring<<endl;
}
The above program when compiled using the vac 8 xlC ,c++ compiler does
not seem to initialise the global variable mystring. any clues on
whats happening? should some flags be included
$ xlC -o mystring mystring.cpp /usr/lib/libC.a
$ ./mystring
value of string is
$
The same program when compiled on a vac 7 xlC compiler works fine!
$xlC -o mystring mystring.cpp /usr/lib/libC.a
$ ./mystring
value of string is ABC
$