My application first reads the parameters from the conf file, and then these parameters can be overwritten from the cli arguments. After it loads the settings from conf, I need to check if the required values are set, but I'm stuck in checking variables.
Code example:
#include <stdio.h>
int main() {
const char* test;
if (test != NULL)
std::cout << test << "\n";
else
std::cout << "no value set\n";
return 0;
}
What have I done wrong?
source
share