Skip to content

Commit 06c51b4

Browse files
Update: added new files for 0x0D-preprocessor
1 parent 9f0856b commit 06c51b4

File tree

7 files changed

+32
-0
lines changed

7 files changed

+32
-0
lines changed

0x0D-preprocessor/0-object_like_macro.h

Whitespace-only changes.

0x0D-preprocessor/1-pi.h

Whitespace-only changes.

0x0D-preprocessor/2-main.c

Whitespace-only changes.

0x0D-preprocessor/3-function_like_macro.h

Whitespace-only changes.

0x0D-preprocessor/4-sum.h

Whitespace-only changes.

0x0D-preprocessor/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 0x0D-preprocessor
2+
3+
### [0-object_like_macro.h](./0-object_like_macro.h)
4+
- Create a header file that defines a macro named SIZE as an abbreviation for the token 1024.
5+
6+
### [1-pi.h](./1-pi.h)
7+
- Create a header file that defines a macro named PI as an abbreviation for the token 3.14159265359.
8+
9+
### [2-main.c](./2-main.c)
10+
- Write a program that prints the name of the file it was compiled from, followed by a new line.
11+
12+
You are allowed to use the standard library
13+
14+
### [3-function_like_macro.h](./3-function_like_macro.h)
15+
- Write a function-like macro ABS(x) that computes the absolute value of a number x.
16+
17+
### [4-sum.h](./4-sum.h)
18+
- Write a function-like macro SUM(x, y) that computes the sum of the numbers x and y.

0x0D-preprocessor/_putchar.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <unistd.h>
2+
3+
/**
4+
* _putchar - writes the character c to stdout
5+
* @c: The character to print
6+
*
7+
* Return: On success 1.
8+
* On error, -1 is returned, and errno is set appropriately.
9+
*/
10+
11+
int _putchar(char c)
12+
{
13+
return (write(1, &c, 1));
14+
}

0 commit comments

Comments
 (0)