Home > Back-end >  On the C programming
On the C programming

Time:09-20

This topic, Dev - c + + error warning is 0
Run, but their flash back, don't know is what reason, is that the 10 integer input, output the smallest number of the first output, the largest number of the final output, and all of the function parameters to use pointer,
How great god is willing to help me to look at, thank you very much

# include
using namespace std;
Int main ()
{int A, [10].
Void input (int x, int);
Void process (int x, int);
Void the output (int x, int);
}
Void input (int x, int)
{int A [10], I;
Cout<& lt;" Input 10 integers: "& lt; for(i=0; i<10; I++)
Cin> A, [I].
Cout}
Void process (int * A, int)
{min Max int * and * and * p, temp.
Max=min=& amp; A, [0].
For (p=A; PIf (* p> * Max)
Max=p;
Else if (* p<* min)
Min=p;
Temp=A, [0].
A [0]=* min;
* min=temp;
If (Max==A)
Max=min;
Temp=A, [9].
A [9]=* Max.
* Max=temp;
}
Void the output (int * A)
{int * p;
For (p=A; P
Cout<& lt;" After the exchange: "& lt; <* p}

CodePudding user response:

Because you write a function calls, no not flash back, there is no execution, you add the calling code,

CodePudding user response:

The main function is the function prototype declaration in it? It should be the lack of function calls, remove the void inside the main function of type declarations,
  • Related