What does return 0 mean in C language?

Release: 2020-03-05 09:25:31
Original
54290 people have browsed it

What does return 0 mean in C language?

The meaning of return 0 in c language:

Recommended: "c Language Tutorial"

1. Return value int Type of function return:

The return statement is used to end the loop or return the value of a function.

return 0: Generally used at the end of the main function, according to the general practice of program development, indicating the successful completion of this function.

2. Boolean type return:

return 0: return false;

return 1: return true;

Examples are as follows:

int main() 
{ 
int a;// 前面一些其他运行// ....// 到最后 
if (a == 100) {
 return 0; 
 } else {
  return -1;
   }
   }
Copy after login

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

The above is the detailed content of What does return 0 mean in C language?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!