i feel kind of stupid asking this, but why for the love of god is this program returning 0 every time...? its supposed to print the ascii value of a character
sizeof returns to size of whatever it's passed in bytes. If you pass that value as an index to an array, you'll probably end up overstepping its bounds because even with a char array (a char is 1 byte long), you'll be getting a value equal to the size of the array which is one more than the last valid index.
It is returning 0 because the main function returns an int. It doesn't actually do anything with it after that because that signals the end of your application.
:o i looked at the answer and the question was messed up. they gave you the function and wanted it to be called with a pointer but in the answer the first parameter was an int not a size_t... go figure