例如:
struct Vertex
{
int x;
int y;
};
Vertex makeVertex(int xpos, int ypos)
{
Vertex tmp = {xpos, ypos};
return tmp;
}
如果我这样做,我会得到内存泄漏吗?:
Vertex a = makeVertex(30,40);
a = makeVertex(5, 102);
例如:
struct Vertex
{
int x;
int y;
};
Vertex makeVertex(int xpos, int ypos)
{
Vertex tmp = {xpos, ypos};
return tmp;
}
如果我这样做,我会得到内存泄漏吗?:
Vertex a = makeVertex(30,40);
a = makeVertex(5, 102);