A simple way to do this in C++
Code:
#include <fstream>
#include <string>
#include <map>
...
std::ifstream constants("constants.txt");
std::map<std::string, double> data;
std::string name;
double value;
while(constants >> name >> value)
{
data[name] = value;
}
and a sample constants file
Code:
test 1
asdf 2.0
pi 3.14
negative -12.34