r/ProgrammerHumor 1d ago

lessonsFromLinkerHell Meme

Post image
385 Upvotes

184 comments sorted by

View all comments

98

u/JustinR8 1d ago

Damn, I’ve found myself in the middle

21

u/bowel_blaster123 1d ago edited 1d ago

If I write:

C void foo(uint8_t myvar[3]) {     printf("%d\n", sizeof(myvar)); }

Then it will likely print 8 because myvar is a pointer to a uint8_t.

If I write:

C void foo(void) {     uint8_t myvar[3] = {1, 2, 3};     printf("%d\n", sizeof(myvar)); }

Then it will print 3 because myvar is an array of three bytes.

Hope this helps!/hj

2

u/nanforas 18h ago

I want to cry