This should be the first things you learn, however as my learning is pretty fragmented I still haven't really learned these things.
I have Formatter.cpp and Formatter.h and Parser.cpp and Parser.h and stdafx.h in each at the top.
I haven't done any classes just functions.
Formatter.cpp has quite a few functions and no prototypes, all the prototypes are in Formatter.h
Parser.cpp has quite a few functions and Formatter.h has just stdafx.h.
All the includes are in stdafx.h including, Formatter.h and Parser.h.
Now this all worked until I needed a global string say,
Now I initially had this in Formatter.cpp which hasCode:string sString = "stuff stuff1 stuff2";and passed this string to a function in Parser.cpp. This gives me a linking error, something like already referenced in Formatter.obj.Code:int main(){}
So how do I understand all these things.
By rule do you always put header guards in all .h files?
And can you not just put all your prototype declarations in one .h files and then include all .h files in stdafx.h?
And how about globals again why can't you just put everything in one header and have that header in stdafx.h?