No.. i don't want to print anything..
I wrote "cout" only for testing the results..
I'll explain:
There's a void function.. than function assign value to a Rect of type Sdl_rect ( i am using SDL2 now )..
If i assign value to the rect by "AssignValue(dstrect, 50, 100), dstrect doesn't change value like i want.. members of this are x,y,w,h.. they keep 0.
The void function is above.. please i need help.. i always did the same with free free pascal and it always worked for me.. please
Yes, please note CodeMonkey's post. It WILL change values if you make the parameter a reference, using &.
Thus: void AssignValue( sdl_rect &Rect, int xx, int yy)
(Note that I have added & ... but I have also changed your original rect (lower case r) to Rect (upper case R) - I'm surprised that your code as written actually compiled.)
You may want to read up on 'constructors' too, as this seems to be what AssignValue is actually doing and it would be quite natural here. Also, make sure that members x and y of your class or structure sdl_rect are public and not private.
Oh thanks, i'll try.
I was writing this topic on the phone.. too possible for presence of errors but syntax is correct i think..
What happens adding &??
I am still learning c++ and coming out from object-pascal programming ( always with SDL2 lib).
I downloaded an app "Learn C++" by SoloLearn .
I am italian but i still learn c++ from that app!
So.. what happens adding & ? I should see