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

>mfw before having to use pointers in C and after I-I don't

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 3

File: ba.jpg (6KB, 259x194px) Image search: [Google]
ba.jpg
6KB, 259x194px
>mfw before having to use pointers in C and after

I-I don't like pointers
>>
>>60473747
it gets easier anon


...no it doesn't
>>
get out now
leave this place
>>
>>60473747
> he doesn't like pointers
Pointers make your life easier anon
>>
>>60473810
...if you're a brainlet
>>
Why are pointers considered so difficult? They're dead simple once you understand the underlying mechanism
>>
>>60473747
It's just a tool access specific memory locations. What's so hard to understand?
>>
File: 1493063086308.jpg (40KB, 490x429px) Image search: [Google]
1493063086308.jpg
40KB, 490x429px
>cant into smart pointers
>cant into RAII
>allocate from stack instead of heap
>cant into MMM

fuck my life /g/
ill forever be a brainlet
>>
>>60473893
you should always allocate on the stack unless you have a good reason for using the heap
>>
>>60473747
Pointers are the ultimate scrub filter. Can't figure out pointers? Get out. Can't use pointers in a real project? Get out. Can't use pointers in a 20,000+ line project? Really get out.
>>
>>60473747

pointer = memory address

that's it

if pointers scare you then you've never worked outside of memory protected enviroments
>>
File: Holistic-Massage.jpg (94KB, 650x472px) Image search: [Google]
Holistic-Massage.jpg
94KB, 650x472px
>>60473747
>mfw garbage collection
>>
using raw pointers is the cancer that killed C++
>>
>>60473747
I was like you OP about two months into learning C. Then my instructor explained it and they are easy. An * always dereferences a memory address to the expected type. A & in front of a variable is referring to the address.

int my_num = 0; //Standard signed integer
int *num_ptr = NULL; //A datatype used to store the LOCATION of an integer
num_ptr = &my_num;//the pointer data type now points to the ADDRESS of the integer

//De-reference the pointer and it's treated like a standard integer
*num_ptr = *num_ptr + 2;
printf("%d\n", *num_ptr);
>>
>>60473747
>Not liking pointers
>Not being a faggot
Pick one
Thread posts: 15
Thread images: 3


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.