Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Discussion on the return value of function in C language

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "the discussion of the return value of function in c language". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn the problem of return value of function in c language.

1. If the function does not return a value, modify the function name with void.

Void func (); / / declares a function that returns no value

2. If the function has a return value, you can modify it with int, float, double, char, etc.

Int func1 (); / / declare a function that returns an integer int type float func2 (); / / declares a function that returns a floating-point float type double func3 (); / / declares a function that returns a floating-point double type char func4 (); / / declares a function that returns a character char type

3. The value of the function can only be returned to the tone function through the return statement.

The type of the function value should be the same as the type of the function in the function definition.

If the function is an integer, the type description can be omitted when the function is defined. If there is no return statement in the called function, the function will bring back the uncertain value, which has no practical meaning.

Thank you for your reading. the above is the content of "discussion on the return value of function in c language". After the study of this article, I believe you have a deeper understanding of the problem of function return value in c language. the specific use also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report