-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnc_conversions.h
79 lines (69 loc) · 2.28 KB
/
nc_conversions.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* conversions.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marvin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/17 15:30:29 by marvin #+# #+# */
/* Updated: 2023/03/17 15:30:29 by marvin ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef NC_CONVERSIONS_H
# define NC_CONVERSIONS_H
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <limits.h>
# include <unistd.h>
# include <ctype.h>
/**
* @brief Converts a string to an integer
*
* @param nptr The pointer of the string to convert
* @return int The integer converted from the string
*/
int nc_atoi(const char *nptr);
/**
* @brief Converts a string to a double
*
* @param str The string to convert
* @return double The double converted from the string
*/
double nc_atod(char *str);
/**
* @brief Converts a lowecase character to an uppercase character
*
* @param c The character to convert
* @return int The converted character
*/
int nc_toupper(int c);
/**
* @brief Converts an uppercase character to a lowercase character
*
* @param c The character to convert
* @return int The converted character
*/
int nc_tolower(int c);
/**
* @brief Converts a character to an integer
*
* @param c The character to convert
* @return int The converted character
*/
int nc_tonum(int c);
/**
* @brief Converts an integer to a character
*
* @param c The integer to convert
* @return int The converted integer
*/
int nc_tochar(int c);
/**
* @brief Converts an integer to a string
*
* @param n The integer to convert
* @return char* The converted integer
*/
char *nc_itoa(int n);
#endif