@Manwithslowbrain first of all thank you for reminding me why I didn’t become a C programmer 25 years ago. And a tip of the hat to @Antelex for encouraging me to encourage a fellow programmer.
@Niten has a good thought to not remember the code but what the code does and sees the relationship to math. So what should you remember about these four values?
(1 + 2 * 3 + 4)
(1 + 2) * (3 + 4)
(1 + 2 * 3 ) + 4
1 + (2 * 3 + 4)
You don’t want to remember the patterns at all. You want to know the order of operations. So you remember PEMDAS. Then you know all sorts of patterns that are generated from that.
So follow @ehcolston’s recommendation to get to know your C syntax. Know all the possible ways you can declare variables. Know all the ways that pointer aritmetic is used and how and why you reference and dereference pointers. Sometimes you might create an acronym for the order of keywords and operators that form a useful pattern but like more complex patterns in coding, there’s always stackoverflow for that. I never felt a need to memorize anything after practicing the pattern until it was like knowing the alphabet.
One last “piece” of advice. You have to know the basics well to understand any variation. Take your avatar for example and his Diabelli Variations:
has to be understood in key, rhythm, harmony, any other distinguishing feature. Then the variations aren’t as hard to remember:
Good luck. It takes about three to five years to be competent in all the forms of a language before you can read any of the combinations. My style of reading code or coding a difficult problem is to break down the parts until each part is easy. Then the whole thing is easy!