You know you’re a nerd when you look at today’s date, November 1st, as 11-01 and then you think, “That’s a binary number!” Yeah, nerd.
Continue reading
Category Archives: Lesson
Filling the Pointer Pointers with Data
The final step of the pointer storage program is to add data to the various buffers, or “sticks,” where ten integer values are stored. This step involves ugly double-pointer notation. If you can, please review last week’s Lesson to get up to speed on how storage is allocated and how these pointers are managed.
Continue reading
Adding Pointers to Pointers
Expanding an allocated buffer is something you can do with a pointer, but not with an array. This flexibility is why I encourage all C language students to understand and use pointers, though it doesn’t make the concept nay less onery.
Continue reading
The Ever-Expanding Pointer Array
Perhaps the most difficult part of learning C is understanding and coding pointers. Even when you have a grip on things, it helps to keep fresh and practice new and utterly obnoxious ways to play with pointers.
Continue reading
Coding a Better stringcopy() Function
From last week’s Lesson, the task is to code a safer, better version of the strcpy() function. The goals are to check buffer size, report an overflow or underflow (buffer is too big or too small), and potentially confirm whether data is overwritten. Such a program is often used as a test when applying for a C programming job.
Continue reading
Copying Strings
The C language has string manipulation functions, but they’re tepid. In fact, the C23 update includes even more functions to duplicate strings and to stick them together. These actions are simple in other languages, but create such a problem for C that coding a string copying function is often a skill you must demonstrate when applying for a C programming job.
Continue reading
Finding Those Pesky Null Characters!
You’ve crafted a brilliant function, ensuring that it properly processes words and generates needed output. Is the code perfect? Well, it looks perfect. But how do you know for certain?
Continue reading
More Array, More Decay
I’ll be blunt: If you want to pass an array to a function, or have a function return an array, just give up now and use pointers. It’s a far easier operation, and it would save me the bother of having to write this post to further discuss the topic of array decay.
Continue reading
The Trouble with Array Decay
Array decay has nothing to do with too much sugar in your code or poor brushing habits. No, it’s a hot topic in C programming, and a source of confusion.
Continue reading
The Story of the Undefined Reference Error
Let me be blunt: If you haven’t yet seen an undefined reference error, you truly aren’t a C programmer. In fact, the more of these messages you see, the longer you’ve been coding in C. Undefined reference errors are a badge of honor.
Continue reading