信息与智能2023NO.8SCIENCE&TECHNOLOGYINFORMATION科技资讯SCIENCE&TECHNOLOGYINFORMATION科技资讯C语言指针变量研究史宇轩1徐洪丽2*丁颐宁3(1.山东理工大学计算机科学与技术学院山东淄博255000;2.山东农业大学信息科学与技术学院山东泰安271018;3.山东科技大学测绘科学与空间信息学院山东青岛266590)摘要:指针在C语言程序设计中占有重要地位,指针变量的灵活性是C语言的主要特色之一。指针变量能够方便表示各种复合数据类型,可以使用数组和字符串,同时也可以处理内存地址。文章首先论述了指针和地址的关系,以及指针的定义;其次,根据指针的实质化繁为简,总结了3种不同的指针赋值方式;再次,给出了常用的指针运算和注意事项;最后,辅助以举例和练习。指针变量的灵活性也带给程序一定的危险性,因此能否正确理解和使用指针是是否掌握C语言的一个标志。关键词:地址和指针指针变量指针变量赋值指针变量运算中图分类号:TP312.1文献标识码:A文章编号:1672-3791(2023)08-0001-04ResearchofPointerVariablesinCLanguageSHIYuxuan1XUHongli2*DINGYining3(1.SchoolofComputerScienceandTechnology,ShangdongUniversityofTechnology,Zibo,ShandongProvince,255000China;2.SchoolofInformationScienceandEngineering,ShandongAgriculturalUniversity,Taian,ShandongProvince,271018China;3.CollegeofGeodesyandGeomatics,ShandongUniversityofScienceandTechnology,Qingdao,ShandongProvince,266590China)Abstract:ThepointeroccupiesanimportantpositioninprogramminginClanguage,andtheflexibilityofpointervariablesisoneofthemainfeaturesofClanguage.Pointervariablescaneasilyrepresentavarietyofcompositedatatypes,canusearraysandstrings,andcanalsohandlememoryaddresses.Thisarticlefirstlydiscussestherelationbe‐tweenpointersandaddressesandthedefinitionofthepointer,thensimplifiesthecomplexaccordingtotheessenceofpointerandsummarizesthreedifferentpointerassignmentmethods,givescommonlyusedpointeroperationsandmattersneedingattentionagain,andfinallygivesauxiliaryexamplesandexercises.Theflexibilityofpointervariablesalsobringssomeriskstotheprogram,sowhetheryoucanunderstandandusepointerscorrectlyisasignofmasteryofClanguage.KeyWords:Addressandpointer;Pointervariable;Pointervariableassignment;P...