When I pass the array using getEnglishWord(counterLine);
counterLine
is array. But when it goes in the void getEnglishWord(int countLine[])
function the only passed is countLine[0]
or the first index
in the array countLine[]
.
CODE
if (countWords == countWordsInput + 1)
{
fclose(fpB);
getEnglishWord(counterLine);
}
Code in void getEnglishWord(int counterLine[]):
int c;
int countLine = 0, countWords = 0, countLetters = 0;
char translatedWords[words][letters];
int indexCount = 0;
c = getc(fpE);
for (int y = 0; y < words; y++)
{
for (int x = 0; x < letters; x++)
translatedWords[y][x] = NULL;
}
while (c != EOF)
{
if (c == '\n')
{
if (countLine == counterLine[indexCount])
{
translatedWords[countWords][countLetters] = c;
countLetters++;
}
indexCount++;
countLine++;
}
c = getc(fpE);
}
fclose(fpE);
_getch();