当前位置:首页 > 心得体会 > [关于C语言中函数参数传递问题的探讨]c语言函数参数单向传递
 

[关于C语言中函数参数传递问题的探讨]c语言函数参数单向传递

发布时间:2019-01-10 04:15:28 影响了:

  摘要:在C语言中,函数是实现程序模块化设计思想的手段。函数在调用过程中常常存在着实参和形参之间的数据传递。文章阐述了调用函数的过程中实参和形参之间数据传递的实质和属性,即值传递和单向性。
  关键词:函数;形参;实参;数据传递
  中图分类号:TP312文献标识码:A 文章编号:1009-3044(2007)17-31457-01
  Analysis of Data Transferring from Actual Argument to Formal Argument in C Language Function Calling
  LU Xiang-ning, LI Xiao-mei
  (Hainan Software Professional Institute, Qionghai 571400,China)
  Abstract: C"s design philosophy is to use functions as building blocks. When a function is called, value of the actual argument is assigned to the variable known as the formal argument. This paper presents that the essence of data transferring from actual argument to formal parameter is value delivery and one-way.
  Key words: functions; formal parameters; actual arguments; data transferring
  
  1 引言
  
  在C语言教学过程中,我发现有很多初学者对函数调用过程中实参和形参之间的数据传递问题理解不够透彻,尤其是指针做函数参数时,常常有许多误解。有这样一个程序:
  #include
  main()
  {
  void swap(int *p1,int *p2);
  int a,b;
  int *point1,*point2;
  clrscr();
  scanf("%d,%d",&a,&b);
  point1=&a;point2=&b;
  if(a 本文为全文原貌 未安装PDF浏览器用户请先下载安装 原版全文

猜你想看
相关文章

Copyright © 2008 - 2022 版权所有 职场范文网

工业和信息化部 备案号:沪ICP备18009755号-3