version 2: ive got it to read the string of characters, but it wont read the values horizontally it will only read them down vertically
Code:
#include <stdio.h>
#include <string.h>
const int rows=100;
const int cols=100;
float num[rows][cols];
float total, arraytotal;
const int maxchars=12;
char name[rows][maxchars];
static char fake[maxchars];
FILE *fp;
main()
{
int i=0;
int j=0;
if((fp = fopen("array.txt","r"))==NULL)
printf("error opening file\n");
else
{
do
{
printf("\t");
fscanf(fp,"%s",&fake);
if(strcmp(fake,"ZZZZZ")!=0)
{
strcpy(name[i],fake);
fscanf(fp,"%f",&num[i][j]);
printf("%5s\n",&name[i]);
}
i++;
j++;
}
while((strcmp(fake,"ZZZZZ")!=0)and(i<rows));
}
fclose(fp);
printf("\n");
getchar();
}