I've written a very simple program that is meant to covert a char to its equivalent ASCII value (eg. A = 65), but I'm getting no output at all. where am i going wrong?
Program: test.c
#include<stdio.h>
int main()
{
char test = 'c';
int key = (int)(test);
printf("%d",key);
return 0;
}
Bash script to compile and run
gcc -o test test.c
test > output
I always end up with output being an empty file.