This month's #cprogramming challenge was inspired by an email question: How to use pointers to work with multi-dimension arrays. Yes it can be done, which is the point of this exercise. Oh, and my C Language Pointers book is for sale on Amazon! https://lnkd.in/geCqE6zb
C Programming Challenge: Pointers and Multi-Dimensional Arrays
More Relevant Posts
-
Weekend learning session. Working on: • Pattern problems • Logic building • DSA fundamentals • Problem-solving approaches One thing I’ve realized: Good coding is not about memorizing syntax — it’s about developing logical thinking and structured problem-solving. Consistency matters more than speed.
To view or add a comment, sign in
-
-
A few hours ago I asked Claude what "u8" meant in some Zig code. Then I asked what "8-bit integer" actually meant. Then how 11111111 could possibly equal 255. Then I finally admitted: "I'm having a difficult time wrapping my head around bits and bytes." That moment — when you stop bluffing and ask the embarrassing question — is the most useful one you get as a learner. So I stopped and dug. An hour later I had: • A real intuition for binary place values • A working mental model of how bytes live in memory • A single-file HTML game to keep practicing The game has four modes: → Explore (toggle bits, watch the math rebuild itself) → Decimal → Binary → Binary → Decimal → 60-second speed run Clickable bit lamps, live equations, side-by-side decimal / hex / binary readouts. Built in one shot with Claude Code while we were talking through the concepts. Why bother? I'm going deep on systems programming for something I'm building in Zig. You can't write low-level code if "what does this bit actually do?" is fuzzy. The foundation has to be solid. #Zig #SystemsProgramming #LearningInPublic #SoftwareEngineering
To view or add a comment, sign in
-
-
You don’t become an expert in programming overnight, and that’s normal. Even Travis Oliphant (creator of NumPy) says he’s been coding for 30+ years and is still learning. What you should do instead: • Ask questions early (don’t wait until you “feel ready”). • Find people who are slightly ahead of you. • Get feedback on what you build. • Accept that confusion is part of the process. Feeling like you don’t know enough isn’t a blocker; it’s the starting point. 👉 Watch the full talk: https://lnkd.in/dq2dZut7
To view or add a comment, sign in
-
I have steadily been reading Designing Data Intensive Applications The Big Ideas Behind Reliable, Scalable, and Maintainable Systems by Martin Kleppman. I am on P.145. It is very slow, dense reading. The content is very relevant. It is also very thoughtful. It took me almost a month to get to P.145. I will probably be reading it on and off for the next several months to finish it. It is not something which you can read quickly. There are many different programming languages, methods of storing information, and applications being described. It also includes descriptions of the hardware being used. There are tables, diagrams, and charts showing different types of information both numerical and textual throughout the book as well as lots of citations, references and a very extensive index. The book has a solid heft to it. It is 590 pages long. I am reading the 2022 edition. There is a second edition which came out on March 24, 2026. I started reading it before the second edition came out.
To view or add a comment, sign in
-
68/365 Another good session, I appreciate that I can interrogate Claude as I work to learn what's going on. Also, it's eliminating "syntax rabbit holes," which is nice. I'd work on something, struggle to get it working, then spend a few hours grinding out syntax to get the code to work only to have lost the conceptual thread once I was finished debugging. It's the difference between learning to write and learning to write a novel.
To view or add a comment, sign in
-
Day 197/365 – DSA Challenge 🚀 Solved Perfect Squares on LeetCode today. 🔹 Problem: Given an integer n, return the least number of perfect square numbers whose sum equals n. A perfect square is a number like: 1, 4, 9, 16, 25... 🔹 Approach Used: Dynamic Programming (DP) 💡 Core Idea: Build the answer for every number from 1 to n. Let: dp[i] = minimum number of perfect squares needed to make i For every number i, try all perfect squares smaller than or equal to i: dp[i] = min(dp[i], dp[i - j*j] + 1) where j*j <= i 🔹 Why This Works? If we already know the optimal answer for smaller values, we can use them to compute the minimum count for larger numbers efficiently. This is a classic bottom-up DP optimization problem. 🔹 Time Complexity: O(n * √n) 🔹 Space Complexity: O(n) 🔹 Example: Input: n = 12 Possible representation: 12 = 4 + 4 + 4 ➡️ Minimum Perfect Squares Needed: 3 ✅ Another Example: 13 = 4 + 9 ➡️ Answer: 2 ✅ 🔥 Key Insight: Many DP problems become easier once you define: what dp[i] represents how smaller subproblems help build larger answers 💻 Language: C++ Dynamic Programming turns brute force into efficient computation 💯 #Day197 #365DaysOfCode #DSA #LeetCode #DynamicProgramming #DP #Cpp #CodingJourney
To view or add a comment, sign in
-
-
Stop guessing how memory works. Start seeing it. 🧠💻 When I first learned C, my biggest struggle wasn't the syntax—it was the "invisible" stuff. I spent hours trying to visualize what was actually happening under the hood: ❌ Where does a pointer actually point? ❌ How does an array of structs look inside the Stack? ❌ Why does my program crash when I lose a Heap address? Most textbooks use static diagrams. But memory is dynamic. It grows, it shrinks, and it moves. That’s why I built Memory Architect — a real-time visualizer that bridges the gap between your code and your RAM. 🚀 What makes it different? ✅ Live C Kernel: Write code and watch the Stack and Heap respond instantly. ✅ Logical Hierarchy: See how "Buildings" (Arrays) contain "Apartments" (Elements) and "Rooms" (Members). ✅ Visual Pointer Tracking: No more confusing memory addresses; see the actual connections. Whether you are a student tackling #CS50, an educator looking for a better teaching tool, or a developer brushing up on the fundamentals, I built this for you. I’m on a mission to make computer science fundamentals accessible and visual. I’d love for the community to try it out! 👇 Link in the comment: (Would love to hear your feedback or see your crazy nested struct visualizations in the comments! 👇) #CProgramming #ComputerScience #SoftwareEngineering #WebDev #CodingInterviews #DataStructures #TechEducation #MemoryArchitect
To view or add a comment, sign in
-
-
🔥 Day 132 of DSA Problem Solving Today I solved a really interesting problem on LeetCode: “1665. Minimum Initial Energy to Finish Tasks” This problem looked simple at first, but the real challenge was figuring out the correct order of tasks to minimize the starting energy. 💡 Problem Idea: Each task contains: actual → energy spent to complete the task minimum → minimum energy required before starting it Goal: 👉 Find the minimum initial energy required to finish all tasks. 🧠 Key Learning: The main insight was: ✔ Tasks should be completed in an optimal greedy order ✔ Sorting by (minimum - actual) in descending order helps preserve maximum flexibility ✔ Greedy + Sorting can transform a difficult simulation problem into a clean optimal solution ⚡ Concepts Practiced: ✔ Greedy Algorithms ✔ Custom Sorting Comparator ✔ Simulation Logic ✔ Optimization Thinking ⏱ Time Complexity: O(n log n) Due to sorting the tasks. 🚀 Real Journey Behind the Solution: Initially, brute force thinking made the problem feel impossible. But once the greedy observation clicked, the implementation became surprisingly clean. #Day132 #DSA #LeetCode #GreedyAlgorithm #Java #CodingJourney #ProblemSolving #Algorithms #Programming
To view or add a comment, sign in
-
-
PODT :》》 Solved an interesting problem today and the fun part was the way I approached it. At first, my mind went toward DFS + Memoization. But while thinking deeper, I noticed something interesting: If we are standing on a taller height, we can only jump to smaller heights. That simple observation changed the whole way of thinking. Instead of recursion, I thought: What if smaller heights are processed first? So by sorting indices based on height and using Dynamic Programming, every smaller reachable answer was already calculated before moving to a bigger height. Sometimes, one small observation completely changes the approach from “complex” to “clean”. This reminded me again that problem solving is not only about knowing algorithms — it is about finding the right way to think. Today’s learning: Before jumping into recursion, try observing dependencies in the problem. Sometimes the solution becomes much simpler. Would you go with DFS + Memoization first or think in terms of ordering + DP? #LeetCode #DSA #DynamicProgramming #Cpp #ProblemSolving #CodingJourney #SoftwareEngineering #LearningInPublic
To view or add a comment, sign in
-
-
a reinterpret_cast in C++ is when you have a block of memory or bytes and you want to interpret the object as a type.. usually you see this at the network boundary when you're streaming raw bytes and want to continue working at run-time presuming the bytes as a type the life lesson of a reinterpret_cast is that sometimes we walk around with conceptual understandings of the world around us, and you can just run a reinterpret_cast on it.. it's kind of like.. people will go on doing what they are doing. chapters start and end, people change and go in different directions. efforts conclude, they fade, they have a trajectory that falls back to earth What you thought was loyalty may have just been proximity. What you thought was momentum may have just been inertia. What you thought was collapse may have just been completion. What you thought was rejection may have just been divergence. What you thought was failure may have just been the end of one valid lifetime. So you reinterpret it. Not because the bytes lied. Not because the past was fake. But because the structure you were imposing on it stopped being useful. A reinterpret_cast is dangerous in C++ because the compiler lets you do it, but it does not promise that the result is safe. Life is similar. You can reinterpret almost anything: a relationship, a company, a season of work, a version of yourself. But the question is whether the new interpretation gives you a truer way to move through the world, or just a convenient way to avoid what happened. Sometimes the cast is cope. Sometimes the cast is wisdom. The skill is knowing the difference. i have posted in a minute so thought i needed to drop some linkedin slop
To view or add a comment, sign in