Hi there, could I please get some guidance? I'm struggling with printing values from my array. What readFile function does is that it opens .txt file and return me line which I choose. It's working as you can see on the picture, which I put under this snippet of the code, but when I want to print values of that array individually, it always gives me the last value and I don't get why, so my question is how to fix this or if it's there another way how to do it. Thanks a lot! I tried to do my best to describe it correctly.
randomNumber function is just a simple generator with max and min limit.
int main()
{
long output[500];
srand(time(NULL));
for (int w = 0; w < words; ++w) {
int randFile = randomNumber(7, 4);
int randLine = randomNumber(500, 0);
output[w] = readFile("C:\\Users\\Snowden\\Desktop\\coursework\\" , randFile, randLine);
printf("\nstdout\t-> %d %s" , w + 1 , output[w]);
}
printf("\nstdout\t-> Your array is: %s-%s-%s-%s-%s" , output[0] , output[1], output[2], output[3], output[4]);
}