Which one is taking more time and why ?
:/home/amaresh/Testing# cat time.c
//#include <stdio.h>
#define EOF -1
int main()
{
register int c;
while ((c = getchar()) != EOF)
{
putchar(c);
} return 0;
} -------------------
WIth stdio.h:-
:/home/amaresh/Testing# time ./time_header hi hi hru? hru?
real 0 m4.202s
user 0 m0.000s
sys 0 m0.004s ------------------
Witout stdio.h and with #define EOF -1 ===================
/home/amaresh/Testing# time ./time_EOF hi hi hru? hru?
real 0 m4.805s
user 0 m0.004s
sys 0 m0.004s
-- From above two case , why 2nd case is taking more time ?
No Answer is Posted For this Question
Be the First to Post Answer
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
What is "far" and "near" pointers in "c"...?
main() { 41printf("%p",main); }8
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
how to return a multiple value from a function?
Printf can be implemented by using __________ list.
how can i cast a char type array to an int type array
How to access command-line arguments?
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); } main() { int a[10][10]; func1(a); func2(a); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above