help with read/write file/array of chars
Hello, Im trying to figure out how write a string into a file, line like this:
Code:
string1; string2; string3;
string4; string5; string6; ect
after this I need to read file line by line and put everithing in to array, like this:
Code:
array1[100]; array2[100]; array3[100];
array4[100]; array5[100]; array6[100];
notice that the string not always have 100 chars because I use this function:
Code:
void ReadString(char caracteres[100])
{
for (i=0; i < 99; i++)
{
c = getchar();
if (c == '\n') {caracteres[i] = '\0'; break;}
caracteres[i] = c;
}
}
Thank u!