say I have some source code MyAmoeba.cpp, with associated header file MyAmoeba.h. Is it considered good or bad practice to include MyAmoeba.h in MyAmoeba.cpp? (I'm assuming it's never necessary, except maybe in a few badly designed cases where the header file contains a macro that makes changes to the source file)
As far as I can see, doing the above would mean that if you change the signature of anything in MyAmoeba.cpp, but forget to do it in MyAmoeba.h, then the error would happen in the compilation stage rather than in the linking stage, but I'm not sure if that's a good/bad/irrelevant thing.
I'm fairly new to c++ btw, in case this question is nonsensical in any way (please point it out to me if so)
Edit: I was playing around with a header file that contained only function declarations, but no class/struct/etc definitions. From other sources and the answers below, it seems to me that when the header file only has declarations, it's not necessary to include the header file in the associated source file, but if there are any definitions in the header file, then it is indeed necessary (because you can declare something as many times as you like, but only define it once, and also a definition can apparently be used in place of a declaration, so the function definitions in my source file would simultaneously count as my declarations).