Home > Back-end >  Guess whether the output of the two programs
Guess whether the output of the two programs

Time:10-15

 # include & lt; stdio.h> 
Int * test1 (void);
Void test2 (int *);
Int main ()
{
Test2 (test1 ());
Test2 (test1 ());
Test1 ();
return 0;
}
Int * test1 (void)
{
//static int a=0;
int a=0;
Int * p=& amp; a;
Printf (" a=% d \ n ", a);
return p;
}

Void test2 (int * p)
{
* p +=5;
}


 # include & lt; stdio.h> 
Int * test1 (void);
Void test2 (int *);
Int main ()
{
Test2 (test1 ());
Test2 (test1 ());
Test1 ();
return 0;
}
Int * test1 (void)
{
Static int a=0;
//int a=0;
Int * p=& amp; a;
Printf (" a=% d \ n ", a);
return p;
}

Void test2 (int * p)
{
* p +=5;
}

CodePudding user response:

Of course not the same as the

Next question

CodePudding user response:

Next question is output two execution as a result,
Haha, just kidding, I myself in learning C, are working on your second question, solves the problems such as post again
  • Related