this post was submitted on 13 Jul 2023
678 points (96.7% liked)
Programmer Humor
32410 readers
1 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
char**So that you can have an array of strings. It's useful to remember that in C arrays and pointers are exactly the same thing, just syntax sugar for however you want to look at it. There are a few exceptions where this isn't true however:
&operatorsizeofalignofwhich decay is a no-nochar[]or wide literal ofwchar_t[], so likechar str[] = "yo mama";But
int**is just an array ofint*, which likewiseint*can just be an array ofint. In the picture here, we haveint** anyathat is an array ofint*with a size of 1,int* anyathat is an array ofintwith a size of 1, and then of course ourintthere being pointed to byint* anya.