Well I want to make a DLL but all of the tutorials online seem to focus tword GUI programing or go a little too fast. Can anyone explain it? As far as I have seen it's syntax resembles resource files. And what makes it a 'Dynamic Link Libray' as in what makes it dynamic?
Oh I want to use this for console app.
If you are using MSVC, then you should just create one "DLL" project with the "hello_world.cpp" file as the source file. And then, create one executable project with the main.cpp file. You need to first compile the DLL project (as "hello_world.dll"), then add the "hello_world.lib" to your link-libraries in your executable's project settings (build options), and then compile the executable. Or, equivalently in command-line:
It works anywhere, but it _should_ not be used in a header file. The motivation is essentially that you don't want it to have repercussions on the code that includes that header file (i.e. the user of the header file might not want to import the std namespace, so you should never do it in a header file). So, the guideline is that if you want to use "using namespace std;" in your code, you have to restrict it only to cpp files, and thus, in the header files, you have to use the full qualifications like "std::string" or "std::cout".