Current location - Quotes Website - Signature design - How to get the return value of return in C? For example: I = I+J; Finally return i;; If I want to display the value of I, how can I get it?
How to get the return value of return in C? For example: I = I+J; Finally return i;; If I want to display the value of I, how can I get it?
for a function with no return value (void), the retry statement is used to directly terminate the function and return to the upper layer.

In addition, using a return statement with a value in a function declared as void is equivalent to modifying the type of the function by default, which does not seem to be in any version of the C rule, but both VC and TC interpret the grammar in this way.

for example, if return 1 appears in a void fun (), the function signature should actually be int fun (), and if return 1. appears, it will be double fun()

Many books? ... class =' class1' > in some older textbooks, a large number of methods of return 1, are used to represent the results of function execution, which actually means pseudo-boolean values. Nowadays, books and more formal textbooks seldom use this return method without relevant statements.

generally speaking, in this kind of example: return 1 means "function ends normally"

return means "function stops abnormally, which does not guarantee the consistency of system state".