Home > Back-end >  Pointer in C language
Pointer in C language

Time:09-15

Why the program wrote complains

CodePudding user response:

You can't be without the previous statement?

CodePudding user response:

The main function has the statement

CodePudding user response:

What's wrong? Can't find jia? State to the front

CodePudding user response:

In the int main () write a

Void jia (int a, b int, int * c);

CodePudding user response:

And your little z placeholders in the printf function

CodePudding user response:

Your printf less % d,
Printf output has certain format, the front without % d, behind the logo without the parameters of the corresponding output,
In addition, the function also use ~ precede to do next

CodePudding user response:

refer to the second floor qq_40406051 response:
has stated in the main function:

Judging from this sentence you should do is not declared

CodePudding user response:

When you call a function, the compiler needs to know the function has several parameters, what they are types, and returns a value of type
For your code, the compiler at compile time, from top to bottom to see your jia (x, y, & amp; Z), it knows that you call a function, but about the function parameters and return values of all don't know, so there may be two types of treatment:
1. An error
2. The warning, but can be compiled through, it will be the default return value type and parameters of the function and then, in this function after the declaration, if it is found that with the expected type or quantity discrepancy, the warning or error

Let the compiler know this function in order to generate the correct machine code is very simple, only need to have a function declaration
Function declarations are the following two conditions:
1. The void fun (void);
It with a semicolon at the end of the function declaration
2. The void fun (void)
{
return ;
}
This is a function definition, its function head is declared

Above two cases in any one appear before you call a function can be
  • Related