J
Jeffrey Baker
Hello,
I wrote a program way back when VC++ 5.0 was around and when using this
program in VC++ 2003 I get garbage. I was able to let the program run
through code that would view the data. Since each object is new there
should be no data to show. Here is some code that would run clean in VC++
5.0 and in VC++ 2003 there is garbage.
//Reproduce Garbage
#include <iostream>
using std::cout;
using std::endl;
class Repro
{
private:
char wd[10];
struct
{
char word[10];
}st;
public:
void View();
};
void Repro::View()
{
cout << "word " << st.word << endl;
cout << "wd " << wd << endl;
}
int main()
{
Repro a;
a.View();
return 0;
}
Regards,
Jeff
I wrote a program way back when VC++ 5.0 was around and when using this
program in VC++ 2003 I get garbage. I was able to let the program run
through code that would view the data. Since each object is new there
should be no data to show. Here is some code that would run clean in VC++
5.0 and in VC++ 2003 there is garbage.
//Reproduce Garbage
#include <iostream>
using std::cout;
using std::endl;
class Repro
{
private:
char wd[10];
struct
{
char word[10];
}st;
public:
void View();
};
void Repro::View()
{
cout << "word " << st.word << endl;
cout << "wd " << wd << endl;
}
int main()
{
Repro a;
a.View();
return 0;
}
Regards,
Jeff