my compiler says expected primary expression before '<<'

#include <string>
#include <fstream>
using namespace std;
struct TempScale
{
double fahrenheit, centigrade;
};
struct Reading
{
int windSpeed;
double humidity;
TempScale temperature;
};
int main()
{
TempScale temp={70, 32};
Reading atmosphere={30, 99};
cout << TempScale << endl;
cout << Reading << endl;
}
cout lives in <iostream>

#include <iostream>
You're also attempting to use the name of a class as if it were an object. And a 'Reading' already 'has-a' TempScale, so how are you initializing that? Last, even if you were printing an object, how does the program know how to print a Reading or a TempScale?
Topic archived. No new replies allowed.