Hello. I was searching on how to copy the string from the first point in the file to the index of comma -1. I have a .mrk file that i would be reading. My idea is that the loop will go through the file and find the comma. There will be a counter to check the num of characters. When found, the first char to char at index of comma-1 is copied to a seperate array. But i do not know how to implement this. This is my code:
FILE *check = fopen("check.mrk","r");
if (check == 0)
{
printf("Could not open the file.\n");
}
else
{
int i;
while((i=fgetc(check))!=EOF)
{
printf("%c",i);
if (i == '\n')
{
printf("\n");
}
}
fclose(check);
}
A guidance on this would be appreciated. Thank you.