Thanks for the link, I think I understand this a little better now but I have come across a problem and I can't see why this doesn't work:
1 2 3 4
//fruit.h
struct fruit {
string name;
}
1 2 3 4 5 6
//main.cpp
#include <string>
#include "fruit.h"
int main()
{ ... }
I keep getting "syntax error : missing ';' before identifier 'name'". Even putting #include<string> in the fruit.h makes no difference. What am I doing wrong?
Heavens no!
After a while you just get accustomed to where you should put the semicolons.
It is annoying until you remember.
(And it's a fashionable, useful punctuation mark but nobody cares about that.)