Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 If int is 2 bytes wide.What will be the output of the program? #include <stdio.h> void fun(char); int main() { char argv[] = {"ab", "cd", "ef", "gh"}; fun(argv); return 0; } void fun(char p) { char t; t = (p+= sizeof(int))[-1]; printf("%s\n", t ?->(Show Answer!)
1. If int is 2 bytes wide.What will be the output of the program? #include <stdio.h> void fun(char); int main() { char argv[] = {"ab", "cd", "ef", "gh"}; fun(argv); return 0; } void fun(char p) { char t; t = (p+= sizeof(int))[-1]; printf("%s\n", t); }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
Since C is a machine dependent language sizeof(int) may return different values. The output for the above program will be cd in Windows (Turbo C) and gh in Linux (GCC). To understand it better, compile and execute the above program in Windows (with Turbo C compiler) and in Linux (GCC compiler).