Hi,
I'm a novice at writing C++ code, most of my experience is in C# and Java. I have tried a bunch of things but I can't seem to figure out the correct way to structure my statements. Rather than try and explain everything I'm doing wrong I will post example problem code.
std::map<ObjectA, Objectb> dict;
int test(ObjectA arg)
{
if(dict[arg] == NULL)
{
dict[arg] = new ObjectB;
initObjectBs(dict[arg]);
}
}
This doesn't compile, obviously. I know that I need reference and pointer operators in there, I just am unsure where as this is a map object I'm using and I'm also not sure how to check for null entries correctly.
Thanks for any help.