In file included from Training 5.cpp:3:
Training5.h:3: parse error before `,' token
Training5.h:5: parse error before `{' token
Training5.h:10: storage size of `pop' isn't known
Training5.h:10: storage size of `pop' isn't known
Training5.h:12: 'string' is used as a type, but is not defined as a type.
Training5.h: In function `int drink(int)':
Training5.h:17: parse error before `}' token
Training5.h: In function `int spill()':
Training5.h:22: parse error before `return'
Training 5.cpp: In function `int main(int, char**)':
Training 5.cpp:8: `Pop' undeclared (first use this function)
Training 5.cpp:8: (Each undeclared identifier is reported only once for each
function it appears in.)
Training 5.cpp:8: parse error before `;' token
Training 5.cpp:9: `Pepsi' undeclared (first use this function)
Training 5.cpp:14: parse error before `;' token
make.exe: *** [5.o"] Error 1
Execution terminated
I have basic knowledge of Java up to classes and filewriting, just trying to get a head start on C++, any help would be much appreciated.
Thanks, I shoulda known better than most of those errors, I'm making C++ more foreign than it needs to be. I'll fix those errors and see if there are other errors.
These errors are left. Would it be possible to explain what these errors are saying in somewhat simpler terms, just so I know what htey are in the future, specifically the ones bolded:
C:\Dev-Cpp\Makefile.win:27: warning: overriding commands for target `"Training'
C:\Dev-Cpp\Makefile.win:24: warning: ignoring old commands for target `"Training'
The top two in bold aren't issues with your code; they're issues with your IDE.
The lower error looks like some kid of namespace/multi-declaration issue. Since you're not using namespaces in your header file, I'm not surprised the compiler doesn't know what to do with string in there, but to be honest I think your best bet is to get an IDE that comes with a compiler made in the last 15 years (C++ has come a long way since Dev-Cpp was last updated (including actually being standarised), assuming you're using Bloodshed Dev-Cpp).