[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
ANON, STOP DICKING AROUND. Can you tell me why someone might
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 12
Thread images: 2
File: 404e_2_0813.jpg (442 KB, 900x601) Image search: [Google]
404e_2_0813.jpg
442 KB, 900x601
ANON, STOP DICKING AROUND. Can you tell me why someone might use a pointer in a project?

No cheating, my prof cant even define a pointer. its kinda sad
>>
>polite sage, because I don't want anyone to catch me spoonfeeding OP
a regular variable is usually a fixed amount of bytes in memory, starting at a certain index in memory.
during a function call you may not want to pass the whole data object you're dealing with, as those become kinda large and hard to deal with. instead you want to pass a pointer to that data object. This pointer is (in C, at least) simply an integer value, describing the location of your data in the process's virtual memory.
Due to the pointer being a fixed length int, it becomes much easier to pass around than, say an array of 1000 characters or a binary tree.
>>
>>54720162
Lol dude that's so, like 1990, just use java like us all.
hahaha.
Wanna go eat curry later ladeh?
>>
>>54720246
If that is the case, why not simply pass the address of the array/btree?
>>
>>54720312
That's what the pointer is....
>>
>>54720162
Hacking bruh
>>
Dynamic memory of any sort
Linked data structures (linked lists, trees, graphs)
Pass by reference semantics
Callback functions

All of these require pointers.
>>
>>54720586
Yo nigga, you knew ruby innit?
Ruby on rails good?
>>
>>54720601

I know Ruby, but I don't really do web development, and I don't know much of Rails, except for the fact that it's a bit bloated. Try it yourself if you're curious. Or just use Sinatra, which is easy to work with.
>>
>>54720162
Say you want to pass a string to a function in C. You pass a pointer to it as an argument. That way the function can modify whatever the pointer points at and modify the source string. Also linked lists, trees, all use pointers. Anything that requires referencing really.
>>
>>54720312
Are you fucking retarded?
>>
File: semen demon.png (173 KB, 276x326) Image search: [Google]
semen demon.png
173 KB, 276x326
>>54720162
Who is this hijabi qt?
Thread replies: 12
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.