Linux C often confuses the concept

Source: Internet
Author: User

pointer function and function pointer

指针函数是指带指针的函数,即本质是一个函数。函数都有返回类型(如果不返回值,则为无值型),只不过指针函数返回类型是某一类型的指针。定义格式类型名 *函数名(函数参数列表)
函数指针是指向函数的指针变量。因而“函数指针”本身首先应是指针变量,只不过该指针变量指向函数。定义格式返回值类型 (*指针变量名)(形参列表)

Pointer array and array pointer

指针数组数组元素全为指针的数组称为指针数组定义格式类型名 *数组标识符[数组元素个数
数组指针数组指针是指向数组地址的指针,其本质为指针声明格式类型名 (*指针变量名)[数组元素个数]

Constant pointer and pointer constant

常量指针常量指针本质是真正,并且这个指针是指向一个常量的指针。(地址可以变,内容不可重新赋值,内容的改变只能通过修改地址指向而改变)定义格式constconst *变量名
指针常量指针常量的本质是一个常量,并且使用指针来修饰它。(地址不可改变,内容可以改变,必须初始化,地址跟随一生)定义格式类型名 *const 变量名

ps:* (pointers) and const (constants) who read before who; * Symbolizes the address, the const symbolizes the content, and who is in front of who is not allowed to change.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux C often confuses the concept

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.