#and ofc theres malloc vs calloc
Explore tagged Tumblr posts
Text
ok i know i make fun of c/c++ for having a bunch of footguns and i've probably used it too long to have a good opinion on this but
C does have a way to do this! it's to put braces after the array! like int a[5] vs int a[5]{}
now. is that intuitive? no. but like. if you wanna do it? it's totally there for you!
can someone explain to me why C doesn't initialize its integer arrays to zeroes
#and ofc theres malloc vs calloc#but a bunch of languages have things about initializing variables i think java does too so c isnt super special here#its just the initialize to 0 syntax is stupid and not really intuitive#armchair computer science
207 notes
ยท
View notes