I am a beginner with C++. When I write the code sometimes I write #include and the code works, other times I don\'t write #include
Even though you haven't explicitly included string, it has been included because of another standard header you included. For example vector may have included string. When you include vector, every thing from vector will get included in your file.
I think future versions of Cpp should have a include_module or module keyword; which only include a specific module from a file. So if a file has 3 classes we only include the one we need.
for example
-I "../mingw/lib/include"
module
Searches the directory for files that define string class. Compilation would be signicantly slower.