This repository contains a collection of C programs that illustrate various concepts in C programming. The programs are organized by topic and are accompanied by brief comments explaining the key concepts and techniques used.
To compile and run these programs, you will need a C compiler such as GCC or Clang. You can install these compilers on your system using a package manager or by downloading them from their respective websites. Once you have a compiler installed, you can navigate to the directory containing the program you wish to run and use the gcc or clang command to compile it, like so:
$ gcc program.c -o program
$ ./programTo search for a specific keyword in this repository, click on the following link:
Search the keyword on the seach bar or add your keyword at the end of the URL, after the q= parameter.
For example, to search for the keyword "example", the URL would be:
https://github.com/Lavin-tom/c_programming/search?q=example
Press enter after adding the keyword to see the search results.
For each topic, there are one or more programs that demonstrate the key concepts.The following table summarizes the concepts covered in this repository:
| Concept | Topics that covered |
|---|---|
| Array | Demonstrates the use of 1D and 2D array |
| Command line arguments | atoiatofatoi_user_functionatof_user_functionload time input |
| Coding challenge | various coding challenge questions in c |
| Condition compilation | #if#else#ifdef#ifndef#endif |
| Control statement | do whilegotopattern programsswitch case |
| Data structure | Linked listcircular linked listdoubly linked listsingly linked listQueue circular queuedouble ended queuepriority queueSorting bubble sortinsertion sortmerge sortquick sortselection sortStack stack linked listbalanced parathesisTree binary treebinary serach tree |
| Dynamic memory allocation | malloccallocreallocfree |
| Enum | Demonstrates the use of enum |
| Files | fgetcfgetsfopenfprintffputcfputsfscanffseekftell |
| Functions | call by valuecall by referencefunction pointers |
| Hacker rank c questions | Various C coding questions from Hackerrank.com |
| Macros | macros with argumentsmacros without argumentsspecial macros |
| Makefile | Demostrates the use of make file concept |
| Multiple file compilations | Demostrate how multiple file compilations works |
| Number Series | Demostrate how multiple file compilations works |
| Operators | bitwiseconditionalincrement and decrementlogicalsizeof |
| Pointers | Various code of pointers and function pointers |
| Random Codes | Most common c coding questions |
| Recursive function | Common c codes with recursive function |
| Storage class | autoexternstaticstatic vs global |
| Strings | strlenstrcpystrncpystrcmpstrncmpstrstrstrchr and various string concepts |
| Structure | Various code of structures |
| Typedef | Demostrate the use of typedef in codes |
| Union | Demostrate union concept with various codes |
| Variable arugument list function | Demostrate varibale argument list function with various codes |
If you have a program or example that you think would be a good addition to this repository, please feel free to submit a pull request or open an issue. Contributions are always welcome!
I am still learning, so the code in this repository may not be optimized and may contain errors or bugs. Please feel free to point out any issues or suggest improvements. Your feedback is greatly appreciated!