Solutions: here
Example 1
void f(char );
int main()
{
int n = 4;
char c = 'h';
f(c);
return 0;
}
void f(char c)
{
double x = 4.7;
cout << c << endl;
//*** point1 ***
}
Example 2
void f(char );
int main()
{
int n = 4;
f('h');
return 0;
}
void f(char c)
{
double x = 4.7;
cout << c << endl;
//*** point1 ***
}
Example 3
void f(char );
int main()
{
int n = 4;
int* A;
A = new int[n]{1, 3, 5, 7};
f('h');
return 0;
}
void f(char c)
{
double x = 4.7;
cout << c << endl;
//*** point1 ***
}
Example 4
void f(int* B);
int main()
{
int n = 4;
int* A;
A = new int[n]{1, 3, 5, 7};
f(A);
return 0;
}
void f(int* B)
{
B[1] = 0;
//*** point1 ***
}
Example 5
void f(int* q);
int main()
{
int n = 4;
int* A;
A = new int[n]{1, 3, 5, 7};
int* p = &A[2];
f(p);
return 0;
}
void f(int* q)
{
*q = 0;
//*** point1 ***
}
Example 6
int* f();
int main()
{
int* A;
A = f();
//*** control point 2 ***
return 0;
}
int* f()
{
int* B = new int[4] = {1, 3, 0, 7};
//*** control point 1 ***
return B;
}