the portability of the compiler.
ready access to the hardware when needed
the standard library concept
Low Level Language Support
#include<stdio.h>
int main()
{
char ch;
int c;
c=open("filename",O_RDONLY);
ch = read(c,&ch,1);
while(ch!=EOF)
{
printf("%c\n", ch);
ch=read(c,&ch,1);
}
return 0;
} i am not able to get that why on providing input program is not terminating it is kepp on asking more inputs (went into infinite loop).
Normally the size of an array can be calculated as :
int i=sizeof(arr)/sizeof(arr[i]); //where i can be any index of the array.
There is another way by which we can calculate the size of an array , lets take an example :
int arr[5]={0}; //arr has 5 elements, all initialized to 0.
now try to print arr and &arr, you will see both will contain same value that is pointing to same array. But when you try to print arr and &arr+1, the &arr+1 will print the memory location after the array arr.
so for example. if arr print 1008 then &arr+1 will print 1028( as size of arr is 5*int ,means 20).
So by this another method we can calculate the size as:
int i=*(&arr+1)-arr;
It looks like you're new here. If you want to get involved, click one of these buttons!