Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active Dec 11, 2018
Embed
What would you like to do?
Funciones chr y ord en C created by parzibyte - https://repl.it/@parzibyte/Funciones-chr-y-ord-en-C
/*
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,
ord(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