Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the following questions in a text file (filename should be netid_lab1answers.txt) and submit this file along with your hello.c program as an archive named

Answer the following questions in a text file (filename should be netid_lab1answers.txt) and submit this file along with your hello.c program as an archive named netid_labw1 with the appropriate archive suffix (e.g., zip, tar, gz, rar)

Add the following variables to your hello.c C program

integer variable called myint

character variable called mychar

an integer pointer called myptr

Add code to your hello.c program to

Print out the "size" (in bytes) of each of these variables.

Print (out in decimal and hexadecimal) the largest decimal value that each of these can hold

1) do the values printed out for the largest decimal value make sense given the size (in bytes) of the variables?

Add one to each of the variables, and print out the resultant value in decimal and hexadecimal.

2) Can you explain why you get the values you do?

Do all of the above exercises again and add -m32 to your gcc command when compiling your hello.c

3) Do the results change? If so, why?

4) What is the difference between executing these two commands on bertvm: ./a.out vs. a.out 5) What are these commands attempting to do, you can assume they are being run on bertvm and that hello.c is a valid C program: gcc -o hello.out hello.c -O2 gcc -S hello.c -O2 6) You compile your program hello.c on bertvm. Where can the executable that is produced be used? (you can see the executable in your mac finder, but can you "execute" the file on the mac?)

7) What are each of the following used for within your shell on a linux/unix machine? |, >, <, &, fg, bg,

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions