search
Homephp教程php手册How to understand about memset function

This article introduces how to understand the memset function. I hope you will learn patiently.

About memset function (initialization function):

void *memset(void *s, int ch, size_t n);
Function explanation: Replace n bytes (typedef unsigned int size_t) following the current position in s with ch and return s.
memset: The function is to fill a given value in a memory block. It is the fastest way to clear a larger structure or array.
The memset() function prototype is extern void *memset(void *buffer, int c, int count) buffer: is a pointer or array, c: is the value assigned to the buffer, count: is the length of the buffer.
Header file: memory.h or string.h

For example: int map[1001][1001];
memset(map,0,sizeof(map));



##About memset function (initialization function): void *memset(void *s, int ch, size_t n);

Function explanation: Set n bytes after the current position in s (typedef unsigned int size_t) Replace s with ch and return s.
memset: The function is to fill a given value in a memory block. It is the fastest way to clear a larger structure or array. The memset() function prototype is extern void *memset(void *buffer, int c, int count) buffer: is a pointer or array, c: is the value assigned to the buffer, count: is the length of the buffer.
Header file: memory.h or string.h

For example: int map[1001][1001];

memset(map,0,sizeof(map));

Related recommendations:

Call Mysql stored procedure input and output parameters

c Language mysql database transaction start, commit, rollback example_MySQL

The above is the detailed content of How to understand about memset function. 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尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment