Back to where I was, now I'm learning how to use fgetc properly. Does fgetc read in a character? If so I can't find my error in my code and I'm getting a a segfault. Can you help fix it and explain why it doesn't work? Thanks
#include<stdio.h>
//declare variables for file input/output
FILE *infile;
char infile_name[15];
FILE *outfile;
char outfile_name[15];
char *buffer;
char fchar;
//declare variables for binary search tree
int main(void) {
printf("p2a ");
scanf("%s,%s \n", infile_name,outfile_name); //reads in file names
printf("Opening file %s ...\n", infile_name);
infile = fopen(infile_name, "r"); //open file stream
fchar = fgetc(infile); //read a character
printf("The first char is %s\n", fchar); //print a character
}