Home >Backend Development >C#.Net Tutorial >Can't the value after return be an expression?

Can't the value after return be an expression?

angryTom
angryTomOriginal
2020-02-13 13:56:2411022browse

Can't the value after return be an expression?

#Can’t the value after return be an expression?

The value after return can be an expression.

return statement

1. Meaning:

return means returning from the called function to the calling function. The return can be accompanied by a Return value, this return value can be a constant, variable, or expression.

(Recommended learning: c language video tutorial)

2. Function:

End the running function and return the function value.

3. Function return value:

The calculation result indicates whether the function is executed smoothly or not (-1, 0)

The return value can be various data types, such as: int, float, double, char, a, *a (pointer), structure or class (c)

int sum(int i,int j)
{
    return i+j;
}

The above is the detailed content of Can't the value after return be an expression?. 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
Previous article:c language color codeNext article:c language color code