Day 26: Multi-Dimensional Arrays in C

Sooo… Yeah, I have now hit my first hiccup. I have always had a slight discomfort with multi-dimensional arrays. Whether it was with Python and neural networks or simple table structures. Now that I am visiting them again with C I want to take a bit of time to run multiple examples. At least that way I know I covered the topic with a bit more effort. So far it has been okay but there is an underlying discomfort there. I wish I could figure out the source of it but now’s not the time for that.

TLDR;

Okay, so here are the highlights of what I did:

  • Started on the “Technical Questions” section of the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. I decided to get a quick intro to the C and Java programming languages before I jump into building the core data structures and algorithms that will be covered in most all technical interviews. I continued with the C for beginners video on YouTube. I am currently working on my notes for multi-dimensional arrays in C. I haven’t gotten very far in my examples but I think I understand the syntax. The only thing left is to write the example code out, compile and run the programs to ensure that it all makes sense.

Multi-dimensional Arrays

The syntax is a bit new to me. For a 2-D array we need to declare it using a syntax like int nums[][]. I believe each of the square brackets represent a dimension of the array.

  • The first set of brackets representing how many rows
  • The second set of brackets representing how many columns
  • etc.

One-dimensional arrays do not need the number of values in the array to be explicitly declared during initialization but rather it can be inferred through assignment. Multi-dimensional arrays are different in that they require the dimensions to be explicitly stated even when assignment and initialization happen at the same time. (Maybe I’m wrong, I don’t know anymore LOL)


Conclusion

That’s all for today. This is my sixth round of the “#100daysofcode” challenge. I will be continuing my work from round five into round six. I am currently working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal is to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in term derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects.