Skip to content

Latest commit

 

History

History

README.md

Preprocessor

Project done during Full Stack Software Engineering studies at ALX Africa SE. It aims to learn about how to include guard in the header files and macros in C language.

Technologies

  • C files are compiled using gcc
  • C files are written according to the C90 standard
  • Tested on Ubuntu 20.04 LTS

Files

All of the following files are programs written in C:

Filename Description
0-object_like_macro.h Header file that defines a macro named SIZE
1-pi.h Header file that defines a macro named PI
2-main.c Prints the name of the file it was compiled from
3-function_like_macro.h Function-like macro ABS(x) that computes the absolute value of a number x
4-sum.h Function-like macro SUM(x,y) that computes the sum of the numbers x and y
101-preprocessor_abuse.c Prints Hello, Holberton
  • Create a header file that defines a macro named SIZE as an abbreviation for the token 1024.
  • Create a header file that defines a macro named PI as an abbreviation for the token 3.14159265359.
  • Write a program that prints the name of the file it was compiled from, followed by a new line.
  • Write a function-like macro ABS(x) that computes the absolute value of a number x.
  • Write a function-like macro SUM(x, y) that computes the sum of the numbers x and y.
  • Write a program that can print Hello, alx_africa, followed by a new line.

Author

Acknowledgements 🙏

All work contained in this project was completed as part of the curriculum for ALX Africa SE. ALX Africa is an online full-stack software engineering program that prepares students for careers in the tech industry using project-based peer learning. For more information, visit this link.

ALX Africa Logo