Question: 4 . Consider the following program: 1 int a = 2 ; 2 void foo ( int b ) { 2 5 8 Lee &

4. Consider the following program:
1 int a =2;
2 void foo(int b){
258 Lee & Seshia, Introduction to Embedded Systems
9. MEMORY ARCHITECTURES
3 printf("%d", b);
4}
5 int main(void){
6 foo(a);
7 a =1;
8}
Is it true or false that the value of a passed to foo will always be 2? Explain.
Assume that this is the entire program, that this program is stored in persistent
memory, and that the program is executed on a bare-iron microcontroller each time
a reset button is pushed.

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 Programming Questions!