Skip to content

Instantly share code, notes, and snippets.

Last active Dec 11, 2018
What would you like to do?
Funciones chr y ord en C created by parzibyte -
Equivalentes a ord y chr en C
@author parzibyte
#include <stdio.h>
int ord(char c);
char chr(int n);
int main(void) {
int valorDeArroba = 64;
char letraA = 'A';
printf("El valor que tiene %d es %c\n", valorDeArroba, chr(valorDeArroba));
printf("El valor numérico que tiene la letra %c es %d\n", letraA,
return 0;
int ord(char c) { return (int)c; }
char chr(int n) { return (char)n; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment