int j = 0;
while ((c = fgetc(file1)) != EOF)
currentLine[j++]= (char)c;
currentLine[j] = 0;
so I should null terminate after the while loop ends right?
int j = 0;
while ((c = fgetc(file1)) != EOF)
currentLine[j++]= (char)c;
currentLine[j] = 0;
so I should null terminate after the while loop ends right?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.