• Returning Multiple Values
    35 replies, posted
[QUOTE=jivemasta;16996638]Holy shit, so many over technical answers. Just make the variables public to whatever scope they need to be used, and assign them in the function. Screw all that pointer bullshit, boo hoo if it uses a whole extra couple bytes worth of memory for a nanosecond that it takes to copy it and delete it. When you need to do this for something big though, like a texture/sound/map/anything over 1KB, do it by pointers.[/QUOTE] sounds like someone cant understand pointers so he bitches about them.
[QUOTE=efeX;17017328]sounds like someone cant understand pointers so he bitches about them.[/QUOTE] I understand pointers just fine thank you, there really isn't much to understand. I just hate it when someone has a simple question and people respond with complicated answers. And usually the answer they give has to do with this notion that if you use one extra bit of memory you are a terrible programmer and should just give up. Some people act like if you don't use the fastest most portable way possible, you aren't worthy. When really all that matters is that you get what you want done. Either way works, but OP may not understand pointers at all, where structs are pretty easy to get even if he's never used one before.
well this IS facepunch. that happens all the time.
Eventually they have to learn no matter how much you think you help by babying them around the harder concepts. Do it right or don't bother imo.
did you miss the point or what
[QUOTE=jivemasta;17018022]I understand pointers just fine thank you, there really isn't much to understand. I just hate it when someone has a simple question and people respond with complicated answers. And usually the answer they give has to do with this notion that if you use one extra bit of memory you are a terrible programmer and should just give up. Some people act like if you don't use the fastest most portable way possible, you aren't worthy. When really all that matters is that you get what you want done. [/QUOTE] Nobody said anything about the extra memory use being a problem at all, if you read carefully. And read the first few posts, that's hardly a complicated answer. Pointers is [I]basic[/I] beginner knowledge that you'll need whenever you deal with objects. [QUOTE=jivemasta;17018022]Either way works, but OP may not understand pointers at all, where structs are pretty easy to get even if he's never used one before.[/QUOTE] I posted three simple examples of how he should be doing it. He has encountered a problem where pointers (or references) is the correct solution, that means it's time to learn about them.
Sorry, you need to Log In to post a reply to this thread.