Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


returning pointers of class arrays

This topic is 5139 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

wow i must be really tired and stupid right now ... cause this should be really easy but i can''t seem to get it to work and my brain hurts ... i have two classes let''s call them CLASS_A and CLASS_B and two arrays of each of these classes VAR_A is of type CLASS_A and VAR_B is of type CLASS_B each with say X number of elements (X is global). i basically want a function that takes both of these arrays and modifies one of them, and since you obviously can''t return refrences to arrays i return a pointer type of CLASS_A. so the function is something like this ... CLASS_A *function (CLASS_A varA[X], CLASS_B varB[X]) my return statement is just ... return varA; ... this function will modifiy all the elements of VarA and i want to return all of them back to VAR_A in main i call this function with this ... VAR_A = function (VAR_A, VAR_B); ... and this doesn''t work "Lvalue required" ... why? i do this type of thing with strings, but this doesnt work ... man i''m probably missing something really stupid ... thanks for any help in advance

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!