C language stipulates that what determines the type of function return value?

Release: 2020-10-13 11:55:29
Original
24006 people have browsed it

C language stipulates that what determines the type of function return value?

#C language stipulates that the type of function return value is determined by the type defined in the function header. The function return value should be consistent with the type defined in the header. If it is inconsistent, the return value will be automatically converted to the type defined in the function header. If no type is defined, it defaults to int type.

Recommended: "c Language Tutorial"

That is to say, what type is your function and what type is the return value.

For example:

Function definition int fun(int a,char b)

The return value is an integer

Function definition int *fun(int a )

The return value is a pointer whose base type is an integer

Function definition void fun(int a)

No return value

More programming related For content, please pay attention to the Introduction to Programming column on the php Chinese website!

The above is the detailed content of C language stipulates that what determines the type of function return value?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template