search
HomeCommon ProblemWhat is the difference between void and int

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.

What is the difference between void and int

#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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

mPDF

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

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.