| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> c/c++ zhong zhi zhen xue xi de liang ge jue hao li zi

c/c++ zhong zhi zhen xue xi de liang ge jue hao li zi

2008-06-01 02:04:44 编辑來源:互联网 评论
 
 
 
本文为【c/c++中指针学习的两个绝好例子】的拼音翻译版
  dui yu zhong duo ren ti chu de c/c++ zhong zhi zhen nan xue de wen ti zuo ge zong jie :
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  zhi zhen xue xi bu hao yao hai shi gai nian bu qing zao cheng de , shuo de jian dan dian jiu shi shu mei you ren zhen kan , zhi zhen de xue xi ru tong ren zai xue xi rao kou ling bu duo kan duo xue duo lian shi bu xing de , xia mian shi liang ge hen jing dian de li zi , hen duo shu shang dou you , dui yu xue xi de chong dian zai yu li jie *x he x de li jie , ta men bing bu xiang tong ,*x suo biao shi de qi shi jiu shi bian liang a ben shen ,x biao shi de shi bian liang a zai nei cun zhong de di zhi , jia ru xiang ming bai ke yi shu chu guan cha cout<<*x""x;, dang ding yi le int *x; hou dui x=&a de li jie de wen ti 。 zai xi yue du he lian xi xia mian de liang ge li zi wo xiang zhi zhen wen ti jiu bu shi nan dian le !#include <stdio.h>
  main()
  {
  int a,b; /* ding yi a,b liang ge zheng xing bian liang yong yu shu ru liang ge zheng shu */
  int *point_1,*point_2,*temp_point; /* ding yi san ge zhi zhen bian liang */
  scanf("%d,%d",&a,&b); /* ge shi hua shu ru a,b de zhi */
  point_1=&a; /* ba zhi zhen bian liang point_1 de zhi zhi xiang bian liang a de di zhi */
  point_2=&b; /* ba zhi zhen bian liang point_2 de zhi zhi xiang bian liang b de di zhi */
  if (a<b)
  {
   temp_point=point_1; /* zhe li de temp_point shi yong yu lin shi cun chu point_1 de zhi ye jiu shi bian liang a de di zhi de */
   point_1=point_2; /* ba point_2 de zhi fu yu point_1 */
   point_2=temp_point;
   /* you yu point_1 de zhi yi jing gai bian wu fa zhao dao , li yong qian mian lin shi cun chu de ye jiu shi temp_point zhao hui yuan point_1 de zhi fu yu point_2, da dao ba point_1 he point_2 zhi dui huan de mu de */
  }
  PRintf("%d,%d",*point_1,*point_2); /* li yong *point_1 he *point_2 ye jiu shi fen bian zhi xiang b he a de fang fa ba zhi xian shi zi ai ping mu shang */
  }
  /* ci ti xu yao zhu chong he le jie shi de ci fa bing mei you gai bian bian liang a,b de zhi zhi shi li yong zhi zhen bian liang fen bie cun chu a he b de di zhi , ran hou zai ba na liang ge zhi zhen bian liang de zhi dui huan yi xia qi shi jiu shi cun chu zai
  zhi zhen bian liang li mian a yu b de di zhi dui huan , zai li yong *point_1 he *point_2 de fang shi ba tiao huan hou de zhi xian shi chu lai zhe li de *point_1 shi ji jiu shi a, ci zhong suan fa bing fei zhen de gai bian a,b de zhi , er shi
  li yong zhi zhen jin xing di zhi jiao huan da dao da xiao pai xu de mu de .
  */
  #include <stdio.h>
  main()
  {
  int a,b; /* ding yi a,b liang ge zheng xing bian liang yong yu shu ru liang ge zheng shu */
  int *point_1,*point_2; /* ding yi san ge zhi zhen bian liang */
  scanf("%d,%d",&a,&b); /* ge shi hua shu ru a,b de zhi */
  point_1 = &a; /* ba zhi zhen bian liang point_1 de zhi zhi xiang bian liang a de di zhi */
  point_2 = &b; /* ba zhi zhen bian liang point_2 de zhi zhi xiang bian liang b de di zhi */
  compositor(point_1,point_2); /* tiao yong zi ding yi de pai xu han shu , ba a,b de di zhi chuan di gei point_1 he point_2 */
  printf("%d,%d",a,b); /* da yin chu a,b de zhi */
  }
  static compositor(p1,p2)
  int *p1,*p2; /* ding yi xing shi shen shu p1,p2 wei zhi zhen bian liang */
  {
  int temp; /* jian li lin shi cun chu bian liang */
   if (*p1<*p2) /* jia ru *p1<p2, zhu chong zhe li de *p1 he *p2 qi shi jiu shi a he b */
   {
   temp = *p1; /* li yong bian liang temp yong yu lin shi cun chu *p1 he jiu shi a de zhi */
  
   *p1 = *p2; /* jiang *p1 de zhi ye jiu shi a de zhi huan cheng *p2 de zhi ye jiu shi b de zhi , deng jia yu a=b */
   *p2 = temp; /* jiang *p2 de zhi ye jiu shi temp de zhi deng jia yu b=temp */
   }
  }
  /* zhu chong : ci ti yu shang ti bu tong de shi , zhi jie gai bian le a yu b de zhi da dao zhen shi gai bian de mu de */
c/c++中指针学习的两个绝好例子
geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
   dui yu zhong duo ren ti chu de c/c++ zhong zhi zhen nan xue de wen ti zuo ge zong jie :    zhi zhen xue xi bu hao yao hai shi gai nian bu qing zao cheng de , shuo de jian dan dian jiu shi shu mei you ren zhen kan , zhi zhen de xue xi ru tong ren zai xue xi rao kou ling bu duo kan duo xue duo lian shi bu xing de , xia mian shi liang ge hen jing dian de li zi , hen duo shu shang dou you , dui yu xue xi de chong dian zai yu li jie *x he x de li jie , ta men bing bu xiang tong ,*x suo biao shi de qi shi jiu shi bian liang a ben shen ,x biao shi de shi bian liang a zai nei cun zhong de di zhi , jia ru xiang ming bai ke yi shu chu guan cha cout<<*x""x;, dang ding yi le int *x; hou dui x=&a de li jie de wen ti 。 zai xi yue du he lian xi xia mian de liang ge li zi wo xiang zhi zhen wen ti jiu bu shi nan dian le !#include <stdio.h> main() { int a,b; /* ding yi a,b liang ge zheng xing bian liang yong yu shu ru liang ge zheng shu */ int *point_1,*point_2,*temp_point; /* ding yi san ge zhi zhen bian liang */ scanf("%d,%d",&a,&b); /* ge shi hua shu ru a,b de zhi */ point_1=&a; /* ba zhi zhen bian liang point_1 de zhi zhi xiang bian liang a de di zhi */ point_2=&b; /* ba zhi zhen bian liang point_2 de zhi zhi xiang bian liang b de di zhi */ if (a<b) { temp_point=point_1; /* zhe li de temp_point shi yong yu lin shi cun chu point_1 de zhi ye jiu shi bian liang a de di zhi de */ point_1=point_2; /* ba point_2 de zhi fu yu point_1 */ point_2=temp_point; /* you yu point_1 de zhi yi jing gai bian wu fa zhao dao , li yong qian mian lin shi cun chu de ye jiu shi temp_point zhao hui yuan point_1 de zhi fu yu point_2, da dao ba point_1 he point_2 zhi dui huan de mu de */ } PRintf("%d,%d",*point_1,*point_2); /* li yong *point_1 he *point_2 ye jiu shi fen bian zhi xiang b he a de fang fa ba zhi xian shi zi ai ping mu shang */ } /* ci ti xu yao zhu chong he le jie shi de ci fa bing mei you gai bian bian liang a,b de zhi zhi shi li yong zhi zhen bian liang fen bie cun chu a he b de di zhi , ran hou zai ba na liang ge zhi zhen bian liang de zhi dui huan yi xia qi shi jiu shi cun chu zai zhi zhen bian liang li mian a yu b de di zhi dui huan , zai li yong *point_1 he *point_2 de fang shi ba tiao huan hou de zhi xian shi chu lai zhe li de *point_1 shi ji jiu shi a, ci zhong suan fa bing fei zhen de gai bian a,b de zhi , er shi li yong zhi zhen jin xing di zhi jiao huan da dao da xiao pai xu de mu de . */ #include <stdio.h> main() { int a,b; /* ding yi a,b liang ge zheng xing bian liang yong yu shu ru liang ge zheng shu */ int *point_1,*point_2; /* ding yi san ge zhi zhen bian liang */ scanf("%d,%d",&a,&b); /* ge shi hua shu ru a,b de zhi */ point_1 = &a; /* ba zhi zhen bian liang point_1 de zhi zhi xiang bian liang a de di zhi */ point_2 = &b; /* ba zhi zhen bian liang point_2 de zhi zhi xiang bian liang b de di zhi */ compositor(point_1,point_2); /* tiao yong zi ding yi de pai xu han shu , ba a,b de di zhi chuan di gei point_1 he point_2 */ printf("%d,%d",a,b); /* da yin chu a,b de zhi */ } static compositor(p1,p2) int *p1,*p2; /* ding yi xing shi shen shu p1,p2 wei zhi zhen bian liang */ { int temp; /* jian li lin shi cun chu bian liang */ if (*p1<*p2) /* jia ru *p1<p2, zhu chong zhe li de *p1 he *p2 qi shi jiu shi a he b */ { temp = *p1; /* li yong bian liang temp yong yu lin shi cun chu *p1 he jiu shi a de zhi */ *p1 = *p2; /* jiang *p1 de zhi ye jiu shi a de zhi huan cheng *p2 de zhi ye jiu shi b de zhi , deng jia yu a=b */ *p2 = temp; /* jiang *p2 de zhi ye jiu shi temp de zhi deng jia yu b=temp */ } } /* zhu chong : ci ti yu shang ti bu tong de shi , zhi jie gai bian le a yu b de zhi da dao zhen shi gai bian de mu de */ [url=http://www.wangchao.net.cn/bbs/pydetail_1785318.html][img]http://image.wangchao.net.cn/it/1323423904050.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
桌球宝贝_性感在蔓延(3)
桌球宝贝_性感在蔓延(2)
银杏树下清纯女孩(9)
银杏树下清纯女孩(8)
痞子的甘南日记
疑是银河落九天
雪域坝上四——纯美色
冬日恋歌——西城杨柳弄轻柔
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有