I have a code snippet that strangely works one way on a fedora 6 machine and another way on a fedora 8 machine.
void Form1::SendToApp()
{
vector<int> isciistream;
vector<int> fontstream;
cout<<"Entering Form1::SendToApp()"<<endl;
isciistream=wwnd->OnOK();
isciistream.push_back(32);
char str[255]="";
cout<<"Size of IsciiStream:"<<isciistream.size()<<endl;
for (int i=0;i<(int)isciistream.size();i++)
{
sprintf(str,"%s%c",str,isciistream[i]);
cout << "isciistream[i] :" << isciistream[i]<< " str:"<<str[i]<<endl;
}
QString temp=str;
const char *foo = temp.ascii();
cout<<"foo:"<<(int)foo[0]<<","<<(int)foo[1]<<","<<(int)foo[2]<<endl;
}
for eg. if isciistream.size=3
isciistream[0]=204
isciistream[1]=32
isciistream[2]=32
on a fedora 6 machine the output i get is
foo: -52,32,32
which is correct.
in a fedora 8 machine i get
foo:32,0,43
I'm not sure why...
any help is appreciated