I am trying to read a few lines from a file and store the ASCII value of each character read as I go line by line. My input looks like this:
Here is what my code originally looked like and what it produced:
char buf3[256], buf5[256], buf6[256], buf7[256], buf4[256], buf9[256];
fscanf(fp, "%[^\n]", buf3);
while (!feof(fp)) {
fscanf(fp, "%s %s %s %s %s", buf4, buf5, buf6, buf7, buf9);
printf("\n%c %c %c %c %c", *buf4, *buf5, *buf6, *buf7, *buf9);
}
I thought printing out %c would give me the ASCII value. Is there a way to convert these values?