Question: IN LINUX 1.Use objdump -D -M intel ex1 to dump the assembly code of ex1.c. Find ex1 is ex1.c's excuation file. ex1.c : #include int
IN LINUX
1.Use "objdump -D -M intel ex1" to dump the assembly code of ex1.c. Find
ex1 is ex1.c's excuation file.
ex1.c :
#include
int main()
{
printf("Hellow ");
fflush(stdout);
for(;;);
return 0;
}
2.What is the function of $ ./ex1 &
3. Run following and tell the difference between gets and fgets
#include
#include
int main(){
char buf[20];
printf("enter a sentence ");
gets(buf);
printf("I got %s from you. length:%d ", buf, strlen(buf));
printf("enter the same sentence again ");
fgets(buf, 20, stdin);
printf("I got %s from you. length:%d ", buf, strlen(buf));
}
4.Write a program to read a sentence and echo it as follows. Use gets() or fgets(). Do "man gets" or "man fgets" to find out the usage of them.
Enter a sentence
aa bcd e e ff aa bcd bcd hijk lmn al bcd
You entered aa bcd e e ff aa bcd bcd hijk lmn al bcd
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
