Here is my code:
#include <iostream>
using namespace std;
struct product {
int weight;
float price;
} apple, banana, melon; // can I declare like this ?????
int main()
{
apple a;
}
When I compiled this sample, the compiler says:
struct.cpp|11|error: expected ';' before 'a'|
Same thing works fine in C language ...
What's wrong?