Ok thanks! I saw an example code somewhere that did that for the headers, so I just always do that for cmath only for whatever reasons. I'll change it.
And so I changed elementinfo argument to string abbr like so:
1 2 3 4 5 6 7 8 9 10 11 12 13
element elementinfo (string abbr)
{
if(abbr == "H")
{
element hydrogen = {"Hydrogen", 1.00794};
return hydrogen;
}
elseif(abbr == "He")
{
element helium = {"Helium", 4.002602};
return helium;
}
}
And I'm still getting errors. Zhuge the compile errors say I have a syntax error on line 15 and that it "can't convert between "char *" and elementinfo(string)".
well to be honest I'm running a pretty ghetto compiler at the moment through the terminal so i cant copy and paste it. I've been meaning to get around to getting a good one though, so I think I'll go do that now. Any suggestions?