-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors_2.c
50 lines (42 loc) · 1.07 KB
/
errors_2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "monty.h"
#include <stdlib.h>
#include <stdio.h>
/**
* pint_error - custom error message for pint error
* due to empty stack.
* @line_number: line number with error.
* Return: void.
*/
void pint_error(unsigned int line_number)
{
fprintf(stderr, "L%u: can't pint, stack empty\n", line_number);
}
/**
* pop_error - custom error message for pop error
* due to empty stack.
* @line_number: line number with error.
* Return: void.
*/
void pop_error(unsigned int line_number)
{
fprintf(stderr, "L%u: can't pop an stack empty\n", line_number);
}
/**
* swap_error - custom error message for short stack.
* @line_number: line number with error.
* Return: void.
*/
void swap_error(unsigned int line_number)
{
fprintf(stderr, "L%u: can't swap, stack too short\n", line_number);
}
/**
* add_error - custom error message for add error
* due to short stack.
* @line_number: line number with error.
* Return: void.
*/
void add_error(unsigned int line_number)
{
fprintf(stderr, "L%u: can't add, stack too short\n", line_number);
}