Home > Back-end >  [Error] ld returned 1 c exit status
[Error] ld returned 1 c exit status

Time:10-26

#include


Int main ()
{
Int Max (int a, int b);
Int min (int a, int b);
Int the sum (int a, int b);

Void process (int (* z) (int, int));

int i,j;

Printf (" please enter the two Numbers: \ n ");
The scanf (" % d % d ", & amp; I, & amp; J);

The process (Max);

The process (min).

The process (sum);

}

Int Max (int a, int b)
{
Int z;
If (a> B) z=a;
If (areturn z;
}

Int min (int a, int b)
{
Int z;
If (a> B) z=b;
If (areturn z;
}

Int the sum (int a, int b)
{
Int z;
Z=a + b;
return z;
}



Results the wrong
C: \ Users \ HP \ AppData \ Local \ Temp \ ccUoQFg0 o pointer to function. CPP: (. Text + 0 x3b) : undefined reference to ` process (int (*) (int, int))
'HP C: \ Users \ \ Desktop \ \ C collect2. Exe [Error] ld returned 1 exit status

CodePudding user response:

The process function without function body, also didn't define the, parameter didn't preach to enter
Void process (int (* z) (int, int)); To void the process (int (* z) (int, int), int, int).
Add a function
Void process (int (* z) (int, int), int a, int b) {
Z (a, b);
}
Then the process is called changes in
Such as the process (main) to process (Max, a, b);
  • Related