Ok so I have struct like this
typedef struct
{
float x;
float y;
char name[];
} pTip;
And another struc
typdef struct
{
float xx;
float yy;
pTip *tip;
}finalTip;
I create and populate a map<string, pTip>
maps
That works fine. I am now trying to generate vector of finalTips
I do:
map<string, pTip>::const_iterator iter = maps.find(p_name);
So it works great my iterator now has what I need and I can extract info with
(iter->second).x
But I want to now using that iterator save it in my finalTip struc obj final So I tried:
finalTip final;
final.tip = iter->second;
And for this case I get error:
error: cannot convert 'const pTip' to 'pTip*' in assignment
So I fixed by:
*final.tip = iter->second;
Was this correct fix or am I doing it wrong. This seems to work but I want to make sure I am doing it right