Posts Tagged ‘c’

Traverse Files In the Source Folder for C++ Lint

Google has an awesome C++ coding style guideline and they have done a very good job on creating a very handy C++ lint based on that guideline. I have downloaded it renamed that script to cpplint, chmod to executable and move to /usr/bin to use. (Also changed the shebang to /us/bin/env python, because default shebang [...]

Auto expanding vectors in C

One or two years ago while writing a C program, I need  Java’s arraylist like generic data-structure for C and wrote the code below. Hope that it will be useful for someone: autoexpandvector.c’s code is as above and you can get the header file,  grab the test code and compilation script from the github repository. [...]

Standard C library Functions That You Should Avoid Using Because of Security

OpenSolaris Project has  a very good reference about the security considerations for the standard C library functions. But here I compiled a list of the most used ones. Also refer to the ACM’s C library Reference page about the functionalities of these functions. gets: This function can cause buffer overflows, because it is impossible to [...]

A Brief Guide to Socket Programming in C

This brief guide is prepared for the people who knows C and have some knowledge about computer networks and protocols. This guide is mainly a summary of several resources indicated in the resources part. For the folks who want to get more information related to some fundemental knowledge related to essentials of computer networks. Please [...]

Memory functions in C and the difference between Memset and Malloc

Memset and malloc are 2 of the most confused functions in C. But actually they have very different usages and functions. “malloc” allocate a memory section whereas memset manipulate the content of the memory section. For instance : char * c; c = (char *) malloc(sizeof(char)); The above code creates and allocates a memory space [...]