Coder Social home page Coder Social logo

alx-low_level_programming's Introduction

C is FUN

Learning C right now, been wanting to get on this. It's going to be FUN !!.

If you need any help. Please do not hesitate to get in touch with me in our Discord Server.


About

  • This repository consists of all the C programming projects done with ALX Africa Full stack Software Engineering course in partnership with Holberton School.
  • All main.c files are prewritten by the school. We build functions that produce a specific output while also taking into consideration edge cases.

Content table

  • 0x00 : Hello, World.
  • 0x01 : Variables,if,else,while.
  • 0x02 : Functions, nested loops.
  • 0x03 : Debugging.
  • 0x04 : More Functions and nested loops.
  • 0x05 : Pointers, arrays and strings.
  • 0x06 : More pointers, arrays and strings.
  • 0x07 : Even more pointers, arrays and strings.
  • 0x08 : Recursion.
  • 0x09 : Static libraries.
  • 0x0A : argc, argv[].
  • 0x0B : Malloc, free.
  • 0x0C : More malloc, free.
  • 0x0D : Preprocessor.
  • 0x0E : Structures, typedef.
  • 0x0F : Function pointers.
  • 0x10 : Variadic functions.
  • 0x11 : Write our own printf project.
  • 0x12 : Singly linked lists.
  • 0x13 : More singly linked lists.
  • 0x14 : Bit manipulation.
  • 0x15 : File I/O.
  • 0x1C : Makefiles.
  • 0x1D : Binary trees.
  • 0x1E : Search Algorithms.

C Program Compilation

The compilation process has four different steps:

  1. The preprocessing stage
  2. The compiling stage
  3. The assembling stage
  4. The linking stage

Step 1: Preprocessing -E

The preprocessor reads the source code and performs various transformations to it:

  • Expanding macros (replacing all of the macros with their values)
  • Handling include files (replaces the #include macro with the content of the header file specified in <>)
  • Removing comments
  • The results in a new file called a translation unit stored in a file with .i extension (intermediate)

Step 2: Compiling -S

The build phase provides us with assembly code that is unique to the target architecture.

In this step the compiler takes action by taking a preprocessed file which checks for syntax or structure errors (in case of errors the compilation process stops and displays the corresponding errors). After compiling it, it generates an intermediate code in assembly language file.s.

Step 3: Assembing -c

In the third stage of compilation, an assembler is used to convert assembly language into machine code. The assembler takes the code and generates an object file file.o, which contains machine code that is not yet executable because it needs to be mapped to a specific memory address. The linker combines all the object files, resolves references between modules, and corrects the addresses, creating an executable file.

Step 4: Linking

The linker is an important tool in compilation that performs two tasks: resolution and relocation of symbols. It arranges the pieces of object code so that functions in one piece can successfully call functions in others. The linker also adds parts that contain the instructions for the library functions used by the program. The result of this stage is the executable file. usually a.out if -o is not specified.


Resource


Author

alx-low_level_programming's People

Contributors

iielwafi avatar

Stargazers

Khadeejah  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.