Question: In LINUX IF ex.1c is #include void main(){ printf(hello ); } gcc -o ex1 ex1.c The compiler has translated the C statements in ex1.c into

In LINUX

IF ex.1c is

#include

void main(){

printf("hello ");

}

gcc -o ex1 ex1.c

The compiler has translated the C statements in ex1.c into machine instructions and stored in ex1(the executable file):

55 -- push rbp

48 89 e5 -- mov rbp, rsp

bf f0 05 40 00 - mov edi, 0x400df0

.........

Find these machine instructions in ex1 with xxd. Use "/pattern" command in vi to search for a string.

2. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!