Like this :
#ifndef API_KEY_VAULT
#define API_KEY_VAULT
#include <string>
using namespace std;
class apiKeyVault{
private:
static string api_key;
public:
apiKeyVault(){}
~apiKeyVault(){}
static string get_apiKey(){
return api_key;
}
};
string apiKeyVault::api_key = "_please_put_your_api_key_here_";
#endif
...
int main(){
...
...
string request("GET /api/latest?access_key="+ apiKeyVault::get_apiKey() +"&format=1\r\n\r\n");
...
...
}
Added class source code to .gitignore, so that it wont push to remote server.
...
apiKey.*
*.exe
...