There were some compiler errors. But after putting some printf's into the code, I found that this:
Var[m] = (int) t5;
is going wrong. Var is an array of ints, but you want to print it as a string. Why not keeping it a string? You should copy the string t5 in an array of strings.
BTW, there is no need to make the variables global in this program, just put them inside the main.
Code:
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXCHARS 100
int main()
{
int m;
FILE *infp;
char line1[MAXCHARS];
char t1[20], t2[20], t3[20], t4[20], t5[20];
int Index[25], Pos[25][11], Var[25];
infp = fopen("Data.txt", "r");
if(infp == NULL)
{
fprintf(stderr, "can't open %s\n", "Data.txt");
exit(EXIT_FAILURE);
}
for (m=0; m<15; m++)
{
if(fgets(line1, MAXCHARS, infp) != NULL)
{
sscanf (line1, "%s %s %s %s %s", t1, t2, t3, t4, t5);
Index[m] = atoi(t1);
Pos[m][1] = atoi(t2);
Pos[m][2] = atoi(t3);
Pos[m][3] = atoi(t4);
Var[m] = (int) t5;
printf ("m %d t5 %s\n", m, t5);
}
}
/*
for (m=0; m<15; m++)
{
printf("%i Index = %i\n",m,Index[m]);
printf("%i Index = %i\n",m,Pos[m][1]);
printf("%i Index = %i\n",m,Pos[m][2]);
printf("%i Index = %i\n",m,Pos[m][3]);
printf("%i Index = %s\n",m,Var[m]);
}
*/
// Done reading input file at this point
fclose(infp);
return(0);
}
[edit]
If you run that code, then you'll see on the screen that t5 has correct values. Instead of assigning t5 to an int, you should use something like strcpy to copy the string into an array of strings.
[/edit]