I have just been very curious as to how header files add functions or anything at all to std because i have tried all the following below but none of them work
The standard library implementation does this: namespace std { void test() {} }
As a user of the C++ implementation, it is incorrect to add things to namespace std, excepting specializations of many templates that depend on a user defined type - for example, std::hash<my_type>. So if your program contained the above, it would be wrong. Only the standard library can legally add functions to namespace std.