{"id":21831746,"url":"https://github.com/nil369/akash_c_code_notes","last_synced_at":"2026-02-26T02:08:59.662Z","repository":{"id":217202072,"uuid":"741597980","full_name":"Nil369/Akash_C_Code_NOTES","owner":"Nil369","description":"This My Coding Notes. I have made this to help others to grasp the basic concept of C as well as as revise VERY EASILY \u0026 systematically.If anyone wants to contribute they can","archived":false,"fork":false,"pushed_at":"2024-08-18T18:09:28.000Z","size":2050,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T12:04:10.219Z","etag":null,"topics":["akash","akash-halder","c","c-notes","nil","nil369"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nil369.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-10T18:14:23.000Z","updated_at":"2024-08-18T18:09:31.000Z","dependencies_parsed_at":"2024-01-24T19:36:34.848Z","dependency_job_id":"9a2cd0bb-d061-47b9-a524-50737f55b122","html_url":"https://github.com/Nil369/Akash_C_Code_NOTES","commit_stats":null,"previous_names":["nil369/akash_c_code_notes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nil369/Akash_C_Code_NOTES","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nil369%2FAkash_C_Code_NOTES","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nil369%2FAkash_C_Code_NOTES/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nil369%2FAkash_C_Code_NOTES/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nil369%2FAkash_C_Code_NOTES/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nil369","download_url":"https://codeload.github.com/Nil369/Akash_C_Code_NOTES/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nil369%2FAkash_C_Code_NOTES/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29848634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akash","akash-halder","c","c-notes","nil","nil369"],"created_at":"2024-11-27T19:15:07.652Z","updated_at":"2026-02-26T02:08:59.648Z","avatar_url":"https://github.com/Nil369.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/Nil369/My-C_Code_NOTES/assets/148447931/1a952c71-bd90-4a92-875a-f7965838e35f\" alt=\"image\" width=\"1100\" height=\"300\"\u003e\n\n\n# C_Notes\n## Author : Akash Halder\n\nThese are my C crisp notes revising them will be very benefitial. But for clear understanding of each \u0026 every concept refer my souce code based notes\n\n\u003ch1\u003eRefer my Source Code for better understanding of these concepts \u003c/h1\u003e\n\n\u003ch1\u003e1. Introduction:\u003c/h1\u003e\n\u003cimg align=\"right\" src=\"https://intellipaat.com/wp-content/uploads/2015/12/c-features.png\" alt=\"C icon\" width=\"400px\"\u003e\n\u003ch3\u003e\n1.  Developed by Dennis Ritchie at Bell Labs in the early 1970s.\n  \n2.  Known for its efficiency, simplicity, and low-level system access.\n   \n3.  Follows a procedural programming paradigm.\n   \n4.  Focuses on functions and structured programming.\n   \n5.  Highly portable language, allowing programs written in C to run on different platforms with minimal modifications.\n   \n6.  C uses a syntax that includes variables, data types, operators, and control structures (loops and conditionals).\n\n7.  To run C/C++ in your system you need 2 things:\n          \u003ch4\u003e ► MinGW compiler =\u003e Just search mingw compiler downloader in google =\u003e Install it \u0026 then set the environment variable by giving the compiler path \u003c/h4\u003e\n          \u003ch4\u003e ► Code Editor/ IDE =\u003e Download VS Code \u003c/h4\u003e\u003cp\u003eI know many people will suggest you to install DevC++/ Turbo C ... But all of these are discontinuos software\u003c/p\u003e\n          \u003ch4\u003e ► Make a file in that editor =\u003ewith \".c \" extension in the file name.\u003c/h4\u003e\n          \u003ch4\u003e ► Install Code Runner Plugin if u r using VS code =\u003e Will run the code easily in the IDE or you have to write some individual code in the terminal.\u003c/h4\u003e\n\u003c/h3\u003e\n\n\u003ch1\u003e2. How is it different from C++?\u003c/h1\u003e\n\u003ch3\u003e\n\n►  The syntax of C++ is almost identical to that of C, as C++ was developed as an extension of C.\n\n►  In contrast to C, C++ supports classes and objects, while C does not.\n\n►  C gives most of the control to the hand of users. Things like memory allocation and manipulation are totally in the hands of the programmer. Being a flexible language, it provides more access to the programmer because of which it is more efficient.\n\n►  C is POP(procedure oriented programming) whereas c++ is OOP(Object oriented programming)\n\u003c/h3\u003e\n\n\u003ch1\u003e3. Basic Structure \u0026 Syntax\u003c/h1\u003e\n\u003cp\u003eProgramming in C involves following a basic structure throughout. Here’s what it can be broken down to.\u003c/p\u003e\n\n\u003ch3\u003e\n\n•  Pre-processor commands\n\n•  Functions\n\n•  Variables\n\n•  Statements\n\n•  Expressions\n\n•  Comments\n\n\u003c/h3\u003e\n\n\u003ch2\u003ePre-processor commands\u003c/h2\u003e\n\u003cp\u003ePre-processor commands are commands which tell our program that before its execution, it must include the file name mentioned in it because we are using some of the commands or codes from this file.\nThey add functionalities to a program.\nOne example could be,\n\u003c/p\u003e\n\n```\n#include \u003cstdio.h\u003e\n\n# include\u003cconio.h\u003e\n\n#include \u003cmath.h\u003e\n```\n\u003cp\u003eWe include math.h to be able to use some special functions like power and absolute. #include\u003cfilename.h\u003e is how we include them into our programs.\nDetailed explanations of everything else in the structure will follow in the later part of the tutorial.\u003c/p\u003e\n\n\u003ch2\u003eHeader files\u003c/h2\u003e\n\u003cp\u003e\n·       Collection of predefined/built in functions developed\n\n·       It is always declares on heading side of program hence it is called header file\n\n·       It is identified with the extension(.h)\n\n·       It gets installed while installing IDE(integrated development environment)\n\n·       It stores functions as per their categories hence they are called library\u003c/p\u003e\n\n\u003cimg align=\"right\" src=\"https://i.redd.it/nmuax05zxoab1.gif\" alt=\"C logo\" width=\"450px\"\u003e\n\n\u003ch2\u003eSyntax\u003c/h2\u003e\n\u003cp\u003eAn example below shows how a basic C program is written.\u003c/p\u003e\n\n\u003cdiv class=\"code-toolbar\"\u003e\u003cpre class=\"language-c\" tabindex=\"0\"\u003e\u003ccode class=\"language-c\"\u003eDeclaration of header file   \t\t\u003cspan class=\"token comment\"\u003e//name of the header files of which functions are been used\u003c/span\u003e\n\u003cspan class=\"token function\"\u003emain\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c/span\u003e\t                           \u003cspan class=\"token comment\"\u003e/*it is called main function which stores the execution of program*/\u003c/span\u003e\n\u003cspan class=\"token punctuation\"\u003e{\u003c/span\u003e\t                                              \u003cspan class=\"token comment\"\u003e//start of the program\u003c/span\u003e\n              \u003cspan class=\"token comment\"\u003e//program statements\u003c/span\u003e\n\u003cspan class=\"token punctuation\"\u003e}\u003c/span\u003e                                                \u003cspan class=\"token comment\"\u003e//end of the program\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003cdiv class=\"toolbar\"\u003e\u003cdiv class=\"toolbar-item\"\u003e\u003cbutton class=\"copy-to-clipboard-button\" type=\"button\" data-copy-state=\"copy\"\u003e\u003c/button\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\n\n\u003cul style=\"list-style-type: square;\"\u003e\n\u003cli\u003eHere, the first line is a pre-processor command including a header file stdio.h.\u003c/li\u003e\n\u003cli\u003eC ignores empty lines and spaces.\u003c/li\u003e\n\u003cli\u003eThere is a main() function then, which should always be there.\u003c/li\u003e\n\u003cli\u003e \u003cb\u003e\"//(Single Line)\"     ||     \"/* */ (Multiline Comment)\" \u003c/b\u003e \u003c/li\u003e\n\u003cli\u003eThis a comment in C language, meaning it will be ignored by the compiler while compiling but it will remain in your source code for other developers to see what does the code do.\u003c/li\u003e\n\u003cli\u003eIn the souce code Notes/ Imp points are written like this refer that.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eA C program is \u003cstrong\u003emade up of different tokens combined\u003c/strong\u003e. These tokens include:\u003c/p\u003e\n\u003cul style=\"list-style-type: square;\"\u003e\n\u003cli\u003eKeywords\u003c/li\u003e\n\u003cli\u003eIdentifiers\u003c/li\u003e\n\u003cli\u003eConstants\u003c/li\u003e\n\u003cli\u003eString Literal\u003c/li\u003e\n\u003cli\u003eSymbols\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eKeywords\u003c/h2\u003e\n\u003cp\u003eKeywords are reserved words that can not be used elsewhere in the program for naming a variable or a function. They have a specific function or task and they are solely used for that. Their functionalities are pre-defined.\nOne such example of a keyword could be return which is used to build return statements for functions. Other examples are auto, if, default, etc. Whenever we write any keyword in IDE  their colour slightly changes and it looks different from other variables or functions for example in turbo c all keywords are turns into white colour .\u003c/p\u003e\n\n\u003ch2\u003eIdentifiers\u003c/h2\u003e\n\u003cp\u003eIdentifiers are names given to variables or functions to differentiate them from one another. Their definitions are solely based on our choice but there are a few rules that we have to follow while naming identifiers. One such rule says that the name can not contain special symbols such as @, -, *, \u003c, etc.\n\nC is a case-sensitive language so an identifier containing a capital letter and another one containing a small letter in the same place will be different. For example, the three words: Code, code, and cOde can be used as three different identifiers.\n\nRules for naming identifier-\n1. One should not name any identifier starting with numeric value or symbol. It should start only with underscore or alphabet \n2. They should not contain space\n3. Giving logical names is recommended as per our program\u003c/p\u003e\n\n\u003ch2\u003eConstants \u0026 Variables in C\u003c/h2\u003e\n\u003cp\u003eVariables are containers for storing data values.\n\u003cb\u003eIn C, there are different types of variables. All these are mentioned in source code download refer that\u003c/b\u003e \u003c/p\u003e\n  \n\u003cp\u003eConstants are very similar to a variable and they can also be of any data type. The only difference between a constant and a variable is that a constant’s value never changes. We will see constants in more detail in the upcoming tutorial.\u003c/p\u003e\n\n\u003ch2\u003eString Literal\u003c/h2\u003e\n\u003cp\u003eString literals or string constants are a sequence of characters enclosed in double quotation marks. For example,  “This is a string literal!” is a string literal. C method printf() utilizes the same to format the output.\u003c/p\u003e\n\n\u003cbr\u003e\n\u003ch1\u003e4. Quick Reference on fundamental concepts of C language: \u003c/h1\u003e\n\n\u003cimg align=\"right\" src=\"https://cdn.icon-icons.com/icons2/2415/PNG/512/c_original_logo_icon_146611.png\" alt=\"C icon\" width=\"400px\"\u003e\n\n\u003ch2\u003eVariables:\u003c/h2\u003e\n\n►  Variables are storage locations in a program that hold values.\n\n►  They have a data type (e.g., int, float, char) that determines the type of data they can hold.\n\n►  Variables can be assigned values and used to perform computations.\u003c/h3\u003e\n\n\u003ch2\u003e Data Types: \u003c/h2\u003e\n\n\n►  Data types define the type of data that a variable can hold.\n\n►  Examples include int (for integers), float (for floating-point numbers), char (for characters), and more.\n\n►  User-defined data types like structures and unions can also be created.\n\n\u003ch2\u003eLoops:\u003c/h2\u003e\n\n►  Loops are control structures that allow the execution of a block of code repeatedly as long as a specified condition is met.\n\n►  Common types of loops in C are for, while, and do-while.\n\n\u003ch2\u003eConditional Statements:\u003c/h2\u003e\n\n►  Conditional statements allow the execution of different code blocks based on certain conditions.\n\n►  The primary conditional statement in C is \u003cb\u003eif-else\u003c/b\u003e, which allows for branching based on true/false conditions.\n\n\u003ch2\u003eArrays:\u003c/h2\u003e\n\n►  Arrays are collections of elements of the same data type under one name.\n\n►  Elements in an array are accessed using an index, which starts from 0.\n\n►  Arrays are useful for storing and manipulating sets of data.\n\n\u003ch2\u003eStrings:\u003c/h2\u003e\n\n►  In C, a string is an array of characters terminated by a null character \\0.\n\n►  String manipulation functions like strlen(), strcpy(), and strcat() are used for handling strings.\n\n\u003ch2\u003e Functions:\u003c/h2\u003e\n\n►  Functions are blocks of code that perform a specific task.\n\n►  They provide modularity, allowing code to be organized into reusable pieces.\n\n►  Functions can have parameters (input) and return a value (output).\n\n\u003ch2\u003ePointers:\u003c/h2\u003e\n\n►  Pointers are variables that store memory addresses.\n\n►  They allow direct access to memory locations and facilitate dynamic memory allocation.\n\n\u003ch2\u003eStructures and Unions:\u003c/h2\u003e\n\n►  Structures allow the grouping of different types of variables under a single name.\n\n►  Unions, like structures, can hold multiple variables, but they share the same memory location.\n\n\u003ch2\u003eFile Handling:\u003c/h2\u003e\n\n►  C provides functions to interact with files for reading from and writing to external storage.\n\n►  Operations like opening, closing, reading, and writing files are supported.\n\n\u003ch2\u003ePreprocessor Directives:\u003c/h2\u003e\n\n►  These are special commands preceded by a # symbol.\n►  They are used to include files, perform conditional compilation, and define constants.\n\n\u003ch2\u003eDynamic Memory Allocation:\u003c/h2\u003e\n\n►  C provides functions like malloc(), calloc(), and realloc() to allocate memory dynamically during program execution.\n\n►  This is useful for managing memory for data structures like linked lists and trees.\n\n\u003ch2\u003eBitwise Operators:\u003c/h2\u003e\n\n►  C supports bitwise operations (AND, OR, XOR, etc.) that work at the bit level.\n\n►  These operations are useful in tasks involving low-level hardware manipulation.\n\n\u003cp\u003e\u003cb\u003eThese are some of the foundational concepts in the C programming language. Understanding these concepts is crucial for writing effective and efficient C programs.\u003c/b\u003e\u003c/p\u003e\n\n\u003chr\u003e\u003cbr\u003e\n\n# C Programming Language Quick Reference\n\nWelcome to the C Programming Language Quick Reference! This README.md file serves as a concise guide to important topics in C programming, providing simple code examples with comments for better understanding.\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Variables and Data Types](#variables-and-data-types)\n3. [Control Flow](#control-flow)\n4. [Functions](#functions)\n5. [Arrays](#arrays)\n6. [Pointers](#pointers)\n7. [Structures](#structures)\n8. [File Handling](#file-handling)\n\n## Introduction\n\nC is a powerful and versatile programming language known for its efficiency and low-level control. It is widely used in systems programming, embedded systems, and software development.\n\n## Variables and Data Types\n\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    // Integer variable\n    int num = 10;\n\n    // Floating-point variable\n    float floatNum = 3.14;\n\n    // Character variable\n    char character = 'A';\n\n    // Display values\n    printf(\"Integer: %d\\n\", num);\n    printf(\"Float: %.2f\\n\", floatNum);\n    printf(\"Character: %c\\n\", character);\n\n    return 0;\n}\n```\n\n## Control Flow\n\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    // If statement\n    int x = 10;\n    if (x \u003e 0) {\n        printf(\"Positive number\\n\");\n    } else if (x \u003c 0) {\n        printf(\"Negative number\\n\");\n    } else {\n        printf(\"Zero\\n\");\n    }\n\n    // Switch statement\n    char grade = 'B';\n    switch (grade) {\n        case 'A':\n            printf(\"Excellent\\n\");\n            break;\n        case 'B':\n            printf(\"Good\\n\");\n            break;\n        default:\n            printf(\"Average\\n\");\n    }\n\n    return 0;\n}\n```\n\n## Functions\n\n```c\n#include \u003cstdio.h\u003e\n\n// Function declaration\nint add(int a, int b) {\n    return a + b;\n}\n\nint main() {\n    // Function call\n    int result = add(5, 7);\n    printf(\"Sum: %d\\n\", result);\n\n    return 0;\n}\n```\n\n## Arrays\n\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    // Array declaration\n    int numbers[5] = {1, 2, 3, 4, 5};\n\n    // Accessing array elements\n    for (int i = 0; i \u003c 5; i++) {\n        printf(\"%d \", numbers[i]);\n    }\n\n    return 0;\n}\n```\n\n## Pointers\n\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    // Pointer declaration\n    int num = 10;\n    int *ptr = \u0026num;\n\n    // Accessing variable through pointer\n    printf(\"Value of num: %d\\n\", *ptr);\n\n    return 0;\n}\n```\n\n## Structures\n\n```c\n#include \u003cstdio.h\u003e\n\n// Structure declaration\nstruct Point {\n    int x;\n    int y;\n};\n\nint main() {\n    // Creating and initializing a structure variable\n    struct Point p1 = {2, 4};\n\n    // Accessing structure members\n    printf(\"Coordinates: (%d, %d)\\n\", p1.x, p1.y);\n\n    return 0;\n}\n```\n\n## File Handling\n\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    // File handling\n    FILE *file = fopen(\"example.txt\", \"w\");\n    if (file != NULL) {\n        fprintf(file, \"Hello, C Programming!\");\n        fclose(file);\n    } else {\n        printf(\"Error opening the file\\n\");\n    }\n\n    return 0;\n}\n```\n\n\u003ch1\u003eRefer my Source Code for better \u0026 clear understanding of these concepts \u003c/h1\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnil369%2Fakash_c_code_notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnil369%2Fakash_c_code_notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnil369%2Fakash_c_code_notes/lists"}