The difference between void and int: 1. Functions defined by void have no return value, while functions defined by int return integer values; 2. Functions preceded by void cannot return any data, and the return statement cannot be used , and the return value of the function preceded by int is an integer, and the return information can be directly used when the function is called.

#The operating environment of this tutorial: Dell G3 computer, Windows 7 system, C# version.
Recommended: "c Language Tutorial"
When defining a function, the difference between void and int: whether the function has a return value
Function defined by void There is no return value, the function defined by int returns an integer value.
Functions preceded by void cannot return any data, and the return statement cannot be used. This type of function should implement all functions that should be implemented within this function. But it's not that you can't exchange data with the outside. You can still pass data through reference parameters, but you can't directly accept the return value when calling, because there is no return value.
For functions preceded by int, the return value is an integer. It may be a number whose result is an integer, or it may be the running status, success or failure identification. When the function is called, the return information can be directly used to implement some Function.
The above is the detailed content of What is the difference between void and int. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.





