Home  >  Article  >  Backend Development  >  C language stipulates that what determines the type of function return value?

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

尚
Original
2020-03-08 21:02:0823945browse

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!

Statement:
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