This is C . If i have an array with SIZE 100, Ex. int dataArr[100] Now, i have t
ID: 3602929 • Letter: T
Question
This is C . If i have an array with SIZE 100, Ex. int dataArr[100] Now, i have to read a text file that have n amount of numbers. How do i determine how many elements of the dataArr[SIZE] have been used for the numbers from text file?This is C . If i have an array with SIZE 100, Ex. int dataArr[100] Now, i have to read a text file that have n amount of numbers. How do i determine how many elements of the dataArr[SIZE] have been used for the numbers from text file?
This is C . Ex. int dataArr[100] Now, i have to read a text file that have n amount of numbers. How do i determine how many elements of the dataArr[SIZE] have been used for the numbers from text file?
Explanation / Answer
Answer will be "n-1",
Bcoz array always starts with "0",
so if n amount of numbers are there Ex 100 number then the array should be 100-1,
suppose, char value=n then, array size will be n-1 Bcoz array always considers from 0 onwards.