Guest_imported
New member
- Jan 1, 1970
- 0
Whats wrong with this code. I keep getting a excess elements in aggregate initializer error.
#include <iostream.h>
#include <stdlib.h>
union UVar
{
char A[5];
int I[10];
float k[8];
};
void main()
{
UVar total = {"STUF", 346576536, 13423.585};
cout.precision(2);
cout.setf(ios::fixed | ios::showpoint);
cout << total.A << *total.I << *total.k << endl;
system("PAUSE"
;
return 0;
}
#include <iostream.h>
#include <stdlib.h>
union UVar
{
char A[5];
int I[10];
float k[8];
};
void main()
{
UVar total = {"STUF", 346576536, 13423.585};
cout.precision(2);
cout.setf(ios::fixed | ios::showpoint);
cout << total.A << *total.I << *total.k << endl;
system("PAUSE"
return 0;
}