Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 29, 2019 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ff5f6c91bba90c3df22562e1ca912951 to your computer and use it in GitHub Desktop.
Save parzibyte/ff5f6c91bba90c3df22562e1ca912951 to your computer and use it in GitHub Desktop.
/*
Convertir int a char en C
@author parzibyte
*/
#include <stdio.h> // printf
// Prototipo
char enteroACaracter(int numero);
int main(){
int numero = 1;
char comoCaracter = enteroACaracter(numero);
printf("El entero %d se convierte a '%c' como carácter", numero, comoCaracter);
}
char enteroACaracter(int numero){
return numero + '0';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment