My point was that you any complications you add to your program make it harder for us to diagnose the root cause. Here, your code contains an additional bug, which isn't present in the following, minimal test case:
#include <iostream>#include <windows.h>int main(){ _TCHAR server[1000] = {}; GetPrivateProfileString("Server", "server", "127.0.0.1", server, 1000, "./data/config.ini"); std::cout << server << '\n';}
Your actual problem is that your functions don't return anything. This is your program relying on more undefined behaviour. You should probably increase your warning level, and make it treat warnings as errors, so that it rejects such programs. You may have an unrelated issue if your file is missing, misnamed or in the wrong directory.