Posts

Buffer overflow

Image
“O’erstep not the modesty of nature.”                                                                                                                                                       — Hamlet, Act III, Scene II

Building a compiler Part. 1 of 4 Getting Started with lex

Image
“Bless thee, Bottom! Bless thee! Thou art translated. I see their knavery: this is to make an ass of me…”                                                                                                                                — A Midsummer Night’s Dream, Act 3, Scene 1

Multithreaded wc

Image
A common utility in Linux and Unix systems is the wc program which is used to count the number of lines, words and characters in the files provided as input.  In this blog we will create a multithreaded version of the wc command where each thread will be responsible for finding the count of the lines, words and characters in one file, and then update the common shared variables for the total lines, words and characters across files. Note: The purpose of this blog is to use threads in a bare bones implementation of wc.

stdio Buffers

Image
stdio Buffers in C What if you want to write a program that displays the classic busy indicator (commonly called a spinner) in C? You can use the '\b' escape sequence to delete the previous character on most terminals and wait for around 1 second before printing the next character. Will this work though?