Double^ test; // < -- Never Initialized, even if it compiled it would crash.
System::String^ str="12.12";
if (Double::TryParse(str, test))
{
rate=test;
}else{
rate=0.0;
}
Potentially Good Code:
1 2 3 4 5 6 7 8
Double test = 0;
System::String^ str="12.12";
if (Double::TryParse(str, test))
{
rate=test;
}else{
rate=0.0;
}
Read the documentation on this, I'm going from memory.