Need to learn about structures in C?
Very neat resource and clear explanations with diagrams. https://www.cs.swarthmore.edu/~newhall/cs31/resources/C-structs_pointers.php
Very neat resource and clear explanations with diagrams. https://www.cs.swarthmore.edu/~newhall/cs31/resources/C-structs_pointers.php
There is a very subtle difference in the following: int *myarray[10] v’s int (*myarray)[10] The first declaration is interpreted as an array of 10 integers, that are pointers. That is you have 1 array holding 10 pointers that are of type integer. The square brackets have a higher precedence so the myarray[10] gets defined first.… Read More »
Learning about pointers in C is no mean feat. It may seem logical and obvious to the well trained but to the beginner or newbie, it is a challenge and a half. Not only that but trying to find good material on learning about C pointers is tricky as well. There is too much information… Read More »
I was researching on what “dnl” meant within a configure.ac file and my Google search showed results from http://www.gnu.org/software/m4/manual/m4-1.4.14/html_node/Dnl.html. Thinking this was the authoritative source, upon reading, I couldn’t for the life of me understand it. After searching some more, it was explained very clearly and succinctly at Stack Overflow of all places. http://stackoverflow.com/questions/3371239/autoconf-dnl-vs In configure.ac, lines commented with… Read More »
Viewing variable values via gdb of a va_list is not as straight forward as gdb> p myvar. It requires a few extra steps not only in execution but in understanding. Read on if you want to know how va_* works and how to view the underlying variables. Step 1: The first step is to understand… Read More »
Have you seen the “at” symbol twice with numbers in between? The double at symbols (@@) are known as chunk symbols and is part of the “Unified Format”. You can probably deduce it to some extent by looking at the graphics below: It basically tells you which lines have changed and the range or number… Read More »
Understanding linked lists is very important when learning C. Understand it, master it and be able to teach it. This link explains it very well. http://cslibrary.stanford.edu/103/LinkedListBasics.pdf The key is to get your hands dirty and not only write the code samples, but experiment and alter the values and play around with it. Here is a link… Read More »
Knowing a nice person is good, being nice, even better but in the computer world, there is this funky concept of “nice” which determines the scheduling priority of a process. The scope here is that you are doing some programming and you want to be able to control or set the priority. You can set… Read More »
If you have come across some code with reference to swab32 or bswap_32 and wondered how it works, here is the answer. swab32 will probably be a function that calls bswap_32 which will probably be a macro. The macro will probably be defined as: ( (((x) << 24) & 0xff000000u) | (((x) << 8) &… Read More »
This is all about endianness. That is, how the bits are arranged in memory. You can arrange these bits in memory 2 ways. In big endian or in little endian. Go to wikipedia for some background but esssentially big endian is the way the decimal system works and little endian is the reverse of this.… Read More »