Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assuming that for the following piece of code memory addresses for the variables defined in main start at address 6 0 0 and for func

Assuming that for the following piece of code memory addresses for the variables defined in main start at address 600 and for func1 at 800, select all statements that are TRUE.
int main(){
int array ={1,2,3,4};
func1(array);
}
void func1(int *q){
int *p = q +4;
while (q < p){
*q =*q +10;
q++;
}
Function func1 increases all values residing in array variable in main by 10
When q is incremented, its value increases by 1 byte
The value assigned to variable p in func1 is 616 because when 4 is added to the value residing in q, the compiler adds 4 x size_of_int
The location / address of variable q increases every time q is incremented inside func1
The initial value residing in variable q when func1 begins its execution is address 800

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

More Books

Students also viewed these Databases questions

Question

=+1. Does your message use pretentious or exaggerated language?

Answered: 1 week ago