Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on the function to convert an integer to any base and return the result as string #11

Closed
nanafox opened this issue Oct 16, 2023 · 0 comments · Fixed by #26
Closed
Assignees

Comments

@nanafox
Copy link
Owner

nanafox commented Oct 16, 2023

Here's the prototype to use

#include "main.h"

/**
 * _itob - convert integer to the specified base and stores the result
 * as a string
 *
 * @number: the number to convert
 * @buffer: the string buffer to store the result
 * @base: the base to convert @number to
 */
void _itob(ssize_t number, char *buffer, int base);

Your function should handle bases 2, 8, 10, and 16. The main.h has macros for these tokens, use them.

Example: BIN is assigned to 2, HEX to 16

@nanafox nanafox linked a pull request Oct 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants