I am from the Fortran community so forgive for asking such a simple question.
I have the following:
char temp_line[250];
char *line;
// read in a file and get first line
line = fgets(temp_line, 250, fp) ;
// Now I want to iterate through each character in line
// my line in reality reads: "H AR "
// So I want to get from the loop my first increment will be H, then empty string, then "A" then "R" etc.
// I am doing following
for (int j =0; line[j] != '\0';j++) printf("%i : %s",j, &line[j])
// the results is:
// 0 : H AR
// 1 : AR
// 2 : AR
// 3 : R
Seems like it is going in reverse direction. Can somebody explain to a new C developer why this is occuring, and how I can achieve my objective?