C++ is case-sensitive. The null value is NULL. However, a double will never be NULL; it is not a pointer.
Also, watch your indentation.
8 9 10 11 12 13 14 15 16 17 18 19
void SymbolTable::insert(string variable, double value)
{
if (value != 0.0)
{
Symbol symbol(variable, value);
elements.push_back(symbol);
}
else
{
cout << "Variables need to be initialized!" << endl;
}
}
Line 12 doesn't make sense to work with a const reference -- you are only creating a local temporary. Technically, you needn't do that either -- you can just pass an unnamed temporary to push_back():
elements.push_back( Symbol(variable, value) );
Finally, it is entirely possible that the user wanted an initial value of zero, so your check and error message seem questionable to me...