Reputation: 42450
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.
Upvotes: 2
Views: 774
Reputation: 93468
test is also a command line application:
test - check file types and compare values
The proper way of executing your little app would be:
./test > output
Upvotes: 4