Jump to content
  • Advertisement
Sign in to follow this  
teslaa66

'=' : left operand must be l-value

This topic is 3700 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

teslaa (7) Oct 26, 2008 at 9:11pm Hi im getting this error error C2106: '=' : left operand must be l-value basically i create a structure
 struct MD2vertex
{
	Vec3f vert;
	Vec3f normal;
};
then i declare a few
struct MD2vertex *pvert1, *pvert2, *pvert3;
then i give one a value
pvert1 = &pframe1->vert[triangles.vert[j]];
then i try and assign that value to the other
pvert3->vert[0] = pvert1->vert[0] + 1;
its this last bit that throws up the error any ideas?

Share this post


Link to post
Share on other sites
Advertisement
This isn't an OpenGL question, but your operator[] implementation probably returns a value, and should return a reference to allow assignation.

Share this post


Link to post
Share on other sites
It seems like what your trying to do is assign a number to an uninitialized pointer.

If it was declared as

struct MD2vertex pvert3;

it should work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!