Escolar Documentos
Profissional Documentos
Cultura Documentos
Enunciado:
SINTAXE DE EXEMPLO:
Solução:
#include <stdio.h>
#include <math.h>
int main() {
char string[MAX_DIGITS];
int16_t inteiro;
IntToStr(21, string);
printf("Value of string: %s, address: %lu\n", string, string);
StrToInt("-1234", &inteiro);
printf("Value of integer: %d\n", inteiro);
return 0;
}
int16_t base;
uint8_t division;
/*
* caso o resultado da divisao seja maior que zero, adiciona o caracter ascii
correspondente
* e subtrai o produto da divisao pela base da vez, do numero
*/
if (division > 0) {
*str = division + CHAR_0_ASCII_CODE;
str++;
str++;
}