DEV Community

Ujjawal Chaudhary
Ujjawal Chaudhary

Posted on

Day 7: Week 1 Retrospective: Mastering C Pointers & Memory Internals

I survived Week 1 of my Low-Level Engineering challenge. πŸš€

This week wasn't just about syntax; it was about mental models. I learned that high-level languages like Python and JS hide a massive amount of complexity from us.

The Big Takeaways:

  1. Arrays are a Lie: They are just pointers to the first element. arr[i] is just syntactic sugar for *(arr + i).
  2. Memory has Geography: The Stack is safe but small. The Heap is massive but dangerous. You have to choose where your data lives.
  3. Strings don't exist: They are just char arrays that hope you didn't forget the null terminator \0.

The Code

I wrote a summary program that uses a Struct to recap the week's stats.



// Day 7: Weekly Retrospective

#include <stdio.h>

struct Week1 {
    int days_coded;
    char *topics_mastered[4];
    char *biggest_struggle;
};

int main() {
    struct Week1 recap = {
        .days_coded = 7,
        .topics_mastered = {
            "Pointer Arithmetic", 
            "Stack vs Heap", 
            "Null Terminators", 
            "Structs"
        },
        .biggest_struggle = "Understanding Array Decay"
    };

    printf("Week 1 Status: COMPLETE βœ…\n");
    printf("Struggle: %s\n", recap.biggest_struggle);

    return 0; // Ready for Week 2
}

πŸ“‚ View the source code on GitHub:https://github.com/Ujjawal0711/30-Days
Enter fullscreen mode Exit fullscreen mode

Top comments (0)