Script for reading text from a file??
Posted: Mon May 10, 2004 4:39 am
What is the Script for reading text from a file
Thank You...
Thank You...
Game Editor discussion board
http://game-editor.com/forum/
char textArray[10][256]; //Max 10 text of 255 characters
int nText = 0; //Number of texts read
void readText(char * fileName)
{
char line[256];
FILE *arq = fopen(fileName, "r");
if(arq)
{
while(fgets(line, 255, arq) && nText < 10)
{
if(strlen(line) > 0) //Dont put empty lines
{
strcpy(textArray[nText], line);
nText++;
}
}
}
}