| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> C/C++ bian cheng xin shou cuo wu yu lu ( xu er )

C/C++ bian cheng xin shou cuo wu yu lu ( xu er )

2008-06-01 02:04:53 编辑來源:互联网 评论
 
 
 
本文为【C/C++编程新手错误语录(续二)】的拼音翻译版
  qian wen hui gu :C/C++ bian cheng xin shou cuo wu yu lu cuo wu yu lu ( xu yi )(13)“ zheng xing bian liang jin jin yi wei zhe yi ge zheng shu ”
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  dang wo men huan shi yi ge xin shou , kan zheng xing jiu shi zheng shu ;
  dang wo men cheng wei gao shou , kan shen me dou shi zheng xing 。
  zheng xing , zai suo you C/C++ ji ben shu ju lei xing zhong zui fu you yi shu mei li he qi huan se cai 。
  wo men cong mou wen ming lun tan de yi pian tie zi kai shi yi kui zheng xing de ao miao 。
  wen :Vxworks cao zuo xi tong qi dong yi ge ren wu de han shu shi taskSpawn(char* name, int PRiority, int options, int stacksize, FUNCPTR function, int arg1,.. , int arg10), ta zhi jie shou zheng xing shen shu , wo gai zen me ban cai neng gei ta chuan yi ge jie gou ti ( zai 32 wei PowerPC ping tai xia )?
  da : ke yi chuan ru jie gou ti de zhi zhen , zai 32 wei PowerPC ping tai xia , zhi zhen ben zhi shang jiu shi yi ge 32 wei zheng shu , zai han shu ti nei jiang zheng xing qiang zhi zhuan hua wei jie gou ti zhi zhen jiu ke fang wen jie gou ti de mei yi ge yuan su 。
  ru :
  // qi dong ren wu 1
  taskSpawn(“task1”, 180, NULL, 10000, Task1Fun, &pStrUCtAr,0,0,0,0,0,0,0,0,0);
  //task1 han shu
  Task1Fun ( int arg1 )
  {
  struct_x * pStructx = (struct_x *) arg1; // jiang zheng xing qiang zhi zhuan hua wei jie gou ti zhi zhen
  …
  }
  zai ci ti chu “ fan zheng xing ” de gai nian ,(unsigned)char、(unsigned)short int、(unsigned)int、(unsigned)long int deng dou shu yu zhe ge fan chou , zhi zhen bi ran shu yu “ fan zheng xing ” de fan wei 。 yong zhi zhen de gao chao jing jie , ye wei jiang qi kan zuo yi ge “ fan zheng xing ”。
  kan kan ruan jian de ju ti she ji wen dang , qi shu ju jie gou ding yi bu fen jing chang kan dao “INT8、UINT8、INT16、UINT16、INT32、UINT32、INT64、UINT64” huo “BYTE、Word、DWORD” deng shu ju lei xing , ta men zai ben zhi shang dou shi (unsigned)char、(unsigned)short int、(unsigned)int、(unsigned)long int hong ding yi de jie guo , dou shu yu “ fan zheng xing ”。 suo yi ,“ fan zheng xing ” de gai nian zhen shi di ti xian zai ri chang de ruan jian she ji dang zhong 。
  
C/C++编程新手错误语录(续二)
geng duo nei rong qing kan C/C++ ji shu zhuan ti java bian cheng kai fa shou ce zhuan ti , huo
  zheng yin wei ge zhong zhi zhen lei xing zai ben zhi shang dou shi “ fan zheng xing ”, yin ci ta men ke yi hu xiang zhuan hua :
  int a, b;
  memset( (char*) &a, (char*) &b, sizeof(int) );
  deng jia yu :
  int a, b;
  a = b;
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  cong lai mei you ren hui yong memset( (char*) &a, (char*) &b, sizeof(int) ) lai dai ti a = b, zhe li zhi shi wei le shuo ming wen ti 。 xia mian de dai ma ze jing chang yong dao :
  int *p = (int *) malloc(100*sizeof(int));
  
   memset ( p, 0, 100*sizeof(int) );// jiang shen qing de nei cun kong jian qing 0
  wo men kan memset de han shu yuan xing wei :
  void * memset ( void * buffer, int c, size_t num );
  shi ji shang ta jie shou de di yi ge shen shu shi wu lei xing zhi zhen , zai memset han shu ti nei , qi ta ren yi lei xing de zhi zhen dou xiang void * zhuan hua le 。 lei si de nei cun cao zuo han shu memcpy suo jie shou de yuan he mu de nei cun di zhi ye shi wu lei xing zhi zhen 。
  char * zhuan hua wei int * hou de zhi sui ran bu bian ( huan shi na ge di zhi ), dan shi qi ++、-- deng cao zuo de han yi que fa sheng le bian hua , zhe ye shi yao zhu chong de 。
  char *p;
  ++p;
  yu
  char *p;
  ++(int *)p;
  de jie guo shi bu yi yang de , qian zhe de p zhi jia le 1, er hou zhe de ze zeng jia le sizeof(int)。
  xia mian lai bo Windows cheng xu she ji zhong xiao xi chuan di han shu liang ge shen shu de pi , kan kan ta men jiu jing shi shen me :
  typedef UINT WPARAM;
  typedef LONG LPARAM;
  yuan lai ,WPARAM he LPARAM qi shi dou shu yu “ fan zheng xing ”, suo yi bu yao bao yuan xiao xi chu li han shu zhi neng jie shou “ fan zheng xing ”。 shi ji shang , cong zhi zhen de jiao du shang lai jiang , zai C/C++ zhong , ke yi huo de ren he lei xing shi li ( bian liang 、 jie gou 、 lei ) de zhi zhen , suo yi Windows de xiao xi chu li han shu shi ji shang ke yi jie shou yi qie lei xing de shen shu 。
  jing tian dong di yi ju hua :“ fan zheng xing ” ke biao zheng yi qie 。
  
C/C++编程新手错误语录(续二)
geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo
  (14)“ zhi chuan di yi ding bu hui gai bian shen shu ”
  li lun er yan , zhi chuan di de que bu hui gai bian shen shu de nei rong 。 dan shi , mou nian mou yue de mou yi tian , ge bi Office de shuo shi mm xie le zhe me yi duan cheng xu , shen shu de zhi que bei gai bian le :
  int n = 9;
  char a[10];
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  example ( n, a ); // tiao yong han shu example(int n,char *pStr)
  printf (“%d”, n ); // shu chu jie guo bu shi 9
  da gai zheng ge office de ren dou bei gao meng le , dou shuo bian yi qi xia gao , you wen ti 。 zhao dao bi zhe , bi zhe ping jie yi wang de jing chang , yi yan jiu kan chu lai bu shi shen me bian yi qi chu cuo , er shi zai han shu example nei dui zi fu chuan a de fang wen yue jie !
  dang zai han shu example nei dui a de fang wen yue jie hou , zai jin xing xie cao zuo shi , jiu you ke neng cao zuo dao le n suo zai de nei cun kong jian , yu shi gai bian le n de zhi 。
  gei chu zhe ge yu lu , bing fei wei le tui fan “ zhi chuan di bu hui gai bian shen shu ” de jie lun , er shi wei le cong ce mian zheng shi zai C/C++ yu yan zhong , shu zu yue jie shi duo me wei xian de cuo wu !
  xia mian de liang ge han shu you ming xian de shu zu yue jie :
  void example1()
  {
  char string[10];
  char* str1 = "0123456789";
  strcpy( string, str1 );
  }
  void example 2(char* str1)
  {
  char string[10];
  if( strlen( str1 ) <= 10 )
  {
  strcpy( string, str1 );
  }
  }
  er zhe ge han shu de yue jie jiu bu zhe me ming xian :
  void example3()
  {
  char string[10], str1[10];
  int i;
  for(i=0; i<10; i++)
  {
  str1[i] = 'a';
  }
  strcpy( string, str1 );
  }
  qi shi , zhe ge han shu wei xian dao le ji dian 。 yin wei dui yu strcpy han shu er yan , kao bei de shi hou yao peng dao ’\0’ cai jie shu ,str1 bing mei you bei fu yu jie shu fu , yin er ni gen ben jiu bu zhi dao strcpy( string, str1 ) de jie guo jiu jing hui shi kao bei duo da yi pian nei cun !
  yi han de shi ,C/C++ yong yuan bu hui zai bian yi he lian jie jie duan ti shi shu zu yue jie , ta zhi hui zai yun xing jie duan dao zhi cheng xu de beng kui 。
  shu zu yue jie , shi da duo shu C/C++ bian cheng xin shou chang fan de cuo wu , er ta you ju you ji da de yin bi xing , xin shou men yi ding yao fei fan zhu chong 。
  
C/C++编程新手错误语录(续二)
geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo
  (15)“C bu gao ji , xue C++、JAVA、C# cai gou wei ”
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  ye xu tan hao qiang lao shi de C yu yan jiao cai shi jue da duo shu gao xiao xue sheng xue xi de di yi men bian cheng ke cheng , suo yi zai xu duo xue sheng de xin mu zhong , jiao de C shi yi zhong ru men ji de yu yan , ta men she qi ji chu er zhui zhu hua shao de Visual XXX、Java、asp、php、.net, ta men yi wei zhe yang zuo “ zhuan da le ”。
  
  
  fei ye !
  C shi yi zhong duo me fu you mei li de yu yan ! zai jin shi de jue dui duo shu di ceng kai fa zhong , reng ran ji hu bei C wan quan long duan 。 zhe xie ling yu bao kuo cao zuo xi tong 、 qian ru shi xi tong 、 shu zi xin hao chu li deng 。 she qi C de jing ji ji chu da .net de gao ceng jian zhu shi zai shi wei xian 。
  wo men zong shi yi wei zi ji ba wo le C, na me qing xie yi ge strcpy de biao zhun han shu 。 nin de da an ruo shi :
  void strcpy( char *strDest, char *strSrc )
  {
  while( (*strDest++ = * strSrc++) != ‘\0’ );
  }
  hen yi han , nin de cheng xu zhi neng na dao E。 kan kan na A de strcpy:
  char * strcpy( char *strDest, const char *strSrc )
  {
  assert( (strDest != NULL) && (strSrc != NULL) );
  char *address = strDest;
  while( (*strDest++ = * strSrc++) != ‘\0’ );
  return address;
  }
  zhe ge cheng xu kao lv le shen me ?
  (1) cheng xu yao qiang da : wei le shi xian lian shi cao zuo , jiang mu de di zhi fan hui , han shu fan hui lei xing gai wei char *
  (2) cheng xu yao ke du : yuan zi fu chuan zhi zhen shen shu jia const xian zhi , biao ming wei shu ru shen shu
  (3) cheng xu yao jian zhuang : yan zheng strDest he strSrc fei kong
  jia ru zhe san dian zhong nin zhi kao lv dao 0 dian huo 1 dian , na me qing hui jia hao hao xiu lian yi xia C。 yin wei zhe ge zui jian dan de strcpy yi yan zheng chu nin de C yu yan ji chu zhi neng jiao zuo “ ru men ”。
  zai xie ge jian dan de strlen, zhe me xie jiu hao le :
  int strlen( const char *str ) // shu ru shen shu wei const
  {
  assert( strt != NULL ); // duan yan zi fu chuan di zhi fei 0
  int len;
  while( (*str++) != '\0' )
  {
  len++;
  }
  return len;
  }
  you ci ke jian , xie hao zhe xie jian dan de han shu ye xu yao shen hou de ji ben gong , yong yuan bu yao fang qi dui ji ben gong de pei yang 。
  
C/C++编程新手错误语录(续二)
geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo
  (16)“ yu yan xue de yue duo yue hao ”
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  xu duo de chu xue zhe dou jing li guo zhe yang de yi ge jie duan , mian dui da liang de bian cheng yu yan he kai fa huan jing , ta men liang gan dao nan yi qu she , bu zhi dao zi ji jiu jing ying gai xue xi shen me 。 yu shi ta men shen me dou xue , jin tian kan yi xia Visual Basic, ming tian kan xue yi xia C++, hou tian zai shu dian kan dao le ben Java bian xin xue lai chao mai hui lai fan fan , da hou tian you fa xian bi xu xue .net le 。 ta men hen tong ku , shen me dou zai kan , jie guo shen me dou mei xue hui , mang mang lu lu er shou huo shen wei 。
  wo men zhen de mei you bi yao zai shen me yu yan dou bu shen jing tong de qing kuang xia luan kan yi qi 。 ren zhun le yi zhong zhen zheng yu yan jiu ying gai jian chi bu xie di nu li 。 yin wei ren he yi men yu yan de ba wo dou fei yi chao yi xi yi shi , bi zhe cong liu nian qian kai shi jie chu C++, zhi dao xian zai , mei yi jie duan reng you xin de qi fa , zai xiang mu kai fa de guo cheng zhong ye bu duan you xin de shou huo 。 jin ri wo huan shi jue dui bu gan xuan cheng zi ji “ jing tong ” zhe men yu yan 。
  xu duo gang bi ye de da xue sheng , dong bu dong jiu zai jian li shang xie shang zi ji jing tong yi dui yu yan 。 yu zhi xiang fan , da duo shu you xiu de gong cheng shi dou bu gan zhe me xie 。 ye xu , yan jiu yue shen , bian yue gan zi shen de wu zhi 。
  zai xia ren wei , yi ge cheng shu de yu yan ti xi ying gai shi :
  cheng xu yuan de yu yan ti xi = yi zhong hui bian + C + yi zhong mian xiang dui xiang (C++、JAVA、C# deng )
  jia ru huan yao jia , na jiu jia yi zhong jie shi xing yu yan ,perl huo tcl( ye xu qi ta )。
  yu yan ju you ji da de xiang si xing , cong C++ guo du dao JAVA zhi xu yao hen duan de yi duan shi jian 。 ge zhong yu yan de fa zhan li shi ye ti xian le bian cheng si xiang de fa zhan shi 。 wo men xue xi yi zhong yu yan , yu fa ye xu bing bu shi zui chong yao de , zui chong yao de shi wen cang zai yu fa wai biao xia de shen ceng te xing he she ji yong yi 。
  ben hui shu zhe luo ci chu , geng duo cuo wu yu lu , dang ran shi dai xu 。
C/C++编程新手错误语录(续二)
geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

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

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

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

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

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

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

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

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

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

 
 
qian wen hui gu :C/C++ bian cheng xin shou cuo wu yu lu cuo wu yu lu ( xu yi )(13)“ zheng xing bian liang jin jin yi wei zhe yi ge zheng shu ”    dang wo men huan shi yi ge xin shou , kan zheng xing jiu shi zheng shu ;    dang wo men cheng wei gao shou , kan shen me dou shi zheng xing 。    zheng xing , zai suo you C/C++ ji ben shu ju lei xing zhong zui fu you yi shu mei li he qi huan se cai 。    wo men cong mou wen ming lun tan de yi pian tie zi kai shi yi kui zheng xing de ao miao 。    wen :Vxworks cao zuo xi tong qi dong yi ge ren wu de han shu shi taskSpawn(char* name, int PRiority, int options, int stacksize, FUNCPTR function, int arg1,.. , int arg10), ta zhi jie shou zheng xing shen shu , wo gai zen me ban cai neng gei ta chuan yi ge jie gou ti ( zai 32 wei PowerPC ping tai xia )?    da : ke yi chuan ru jie gou ti de zhi zhen , zai 32 wei PowerPC ping tai xia , zhi zhen ben zhi shang jiu shi yi ge 32 wei zheng shu , zai han shu ti nei jiang zheng xing qiang zhi zhuan hua wei jie gou ti zhi zhen jiu ke fang wen jie gou ti de mei yi ge yuan su 。    ru : // qi dong ren wu 1 taskSpawn(“task1”, 180, NULL, 10000, Task1Fun, &pStrUCtAr,0,0,0,0,0,0,0,0,0); //task1 han shu Task1Fun ( int arg1 ) { struct_x * pStructx = (struct_x *) arg1; // jiang zheng xing qiang zhi zhuan hua wei jie gou ti zhi zhen … }    zai ci ti chu “ fan zheng xing ” de gai nian ,(unsigned)char、(unsigned)short int、(unsigned)int、(unsigned)long int deng dou shu yu zhe ge fan chou , zhi zhen bi ran shu yu “ fan zheng xing ” de fan wei 。 yong zhi zhen de gao chao jing jie , ye wei jiang qi kan zuo yi ge “ fan zheng xing ”。    kan kan ruan jian de ju ti she ji wen dang , qi shu ju jie gou ding yi bu fen jing chang kan dao “INT8、UINT8、INT16、UINT16、INT32、UINT32、INT64、UINT64” huo “BYTE、Word、DWORD” deng shu ju lei xing , ta men zai ben zhi shang dou shi (unsigned)char、(unsigned)short int、(unsigned)int、(unsigned)long int hong ding yi de jie guo , dou shu yu “ fan zheng xing ”。 suo yi ,“ fan zheng xing ” de gai nian zhen shi di ti xian zai ri chang de ruan jian she ji dang zhong 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785325.html][img]http://image.wangchao.net.cn/it/1323423870012.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti java bian cheng kai fa shou ce zhuan ti , huo    zheng yin wei ge zhong zhi zhen lei xing zai ben zhi shang dou shi “ fan zheng xing ”, yin ci ta men ke yi hu xiang zhuan hua : int a, b; memset( (char*) &a, (char*) &b, sizeof(int) );    deng jia yu : int a, b; a = b;    cong lai mei you ren hui yong memset( (char*) &a, (char*) &b, sizeof(int) ) lai dai ti a = b, zhe li zhi shi wei le shuo ming wen ti 。 xia mian de dai ma ze jing chang yong dao : int *p = (int *) malloc(100*sizeof(int)); memset ( p, 0, 100*sizeof(int) ); // jiang shen qing de nei cun kong jian qing 0    wo men kan memset de han shu yuan xing wei : void * memset ( void * buffer, int c, size_t num );    shi ji shang ta jie shou de di yi ge shen shu shi wu lei xing zhi zhen , zai memset han shu ti nei , qi ta ren yi lei xing de zhi zhen dou xiang void * zhuan hua le 。 lei si de nei cun cao zuo han shu memcpy suo jie shou de yuan he mu de nei cun di zhi ye shi wu lei xing zhi zhen 。   char * zhuan hua wei int * hou de zhi sui ran bu bian ( huan shi na ge di zhi ), dan shi qi ++、-- deng cao zuo de han yi que fa sheng le bian hua , zhe ye shi yao zhu chong de 。 char *p; ++p;    yu char *p; ++(int *)p;    de jie guo shi bu yi yang de , qian zhe de p zhi jia le 1, er hou zhe de ze zeng jia le sizeof(int)。    xia mian lai bo Windows cheng xu she ji zhong xiao xi chuan di han shu liang ge shen shu de pi , kan kan ta men jiu jing shi shen me : typedef UINT WPARAM; typedef LONG LPARAM;    yuan lai ,WPARAM he LPARAM qi shi dou shu yu “ fan zheng xing ”, suo yi bu yao bao yuan xiao xi chu li han shu zhi neng jie shou “ fan zheng xing ”。 shi ji shang , cong zhi zhen de jiao du shang lai jiang , zai C/C++ zhong , ke yi huo de ren he lei xing shi li ( bian liang 、 jie gou 、 lei ) de zhi zhen , suo yi Windows de xiao xi chu li han shu shi ji shang ke yi jie shou yi qie lei xing de shen shu 。    jing tian dong di yi ju hua :“ fan zheng xing ” ke biao zheng yi qie 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785325.html][img]http://image.wangchao.net.cn/it/1323423870040.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo (14)“ zhi chuan di yi ding bu hui gai bian shen shu ”    li lun er yan , zhi chuan di de que bu hui gai bian shen shu de nei rong 。 dan shi , mou nian mou yue de mou yi tian , ge bi Office de shuo shi mm xie le zhe me yi duan cheng xu , shen shu de zhi que bei gai bian le : int n = 9; char a[10]; example ( n, a ); // tiao yong han shu example(int n,char *pStr) printf (“%d”, n );  // shu chu jie guo bu shi 9    da gai zheng ge office de ren dou bei gao meng le , dou shuo bian yi qi xia gao , you wen ti 。 zhao dao bi zhe , bi zhe ping jie yi wang de jing chang , yi yan jiu kan chu lai bu shi shen me bian yi qi chu cuo , er shi zai han shu example nei dui zi fu chuan a de fang wen yue jie !    dang zai han shu example nei dui a de fang wen yue jie hou , zai jin xing xie cao zuo shi , jiu you ke neng cao zuo dao le n suo zai de nei cun kong jian , yu shi gai bian le n de zhi 。    gei chu zhe ge yu lu , bing fei wei le tui fan “ zhi chuan di bu hui gai bian shen shu ” de jie lun , er shi wei le cong ce mian zheng shi zai C/C++ yu yan zhong , shu zu yue jie shi duo me wei xian de cuo wu !    xia mian de liang ge han shu you ming xian de shu zu yue jie : void example1() { char string[10]; char* str1 = "0123456789"; strcpy( string, str1 ); } void example 2(char* str1) { char string[10]; if( strlen( str1 ) <= 10 ) { strcpy( string, str1 ); } }    er zhe ge han shu de yue jie jiu bu zhe me ming xian : void example3() { char string[10], str1[10]; int i; for(i=0; i<10; i++) { str1[i] = 'a'; } strcpy( string, str1 ); }    qi shi , zhe ge han shu wei xian dao le ji dian 。 yin wei dui yu strcpy han shu er yan , kao bei de shi hou yao peng dao ’\0’ cai jie shu ,str1 bing mei you bei fu yu jie shu fu , yin er ni gen ben jiu bu zhi dao strcpy( string, str1 ) de jie guo jiu jing hui shi kao bei duo da yi pian nei cun !    yi han de shi ,C/C++ yong yuan bu hui zai bian yi he lian jie jie duan ti shi shu zu yue jie , ta zhi hui zai yun xing jie duan dao zhi cheng xu de beng kui 。    shu zu yue jie , shi da duo shu C/C++ bian cheng xin shou chang fan de cuo wu , er ta you ju you ji da de yin bi xing , xin shou men yi ding yao fei fan zhu chong 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785325.html][img]http://image.wangchao.net.cn/it/1323423870104.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo (15)“C bu gao ji , xue C++、JAVA、C# cai gou wei ”    ye xu tan hao qiang lao shi de C yu yan jiao cai shi jue da duo shu gao xiao xue sheng xue xi de di yi men bian cheng ke cheng , suo yi zai xu duo xue sheng de xin mu zhong , jiao de C shi yi zhong ru men ji de yu yan , ta men she qi ji chu er zhui zhu hua shao de Visual XXX、Java、asp、php、.net, ta men yi wei zhe yang zuo “ zhuan da le ”。    fei ye !   C shi yi zhong duo me fu you mei li de yu yan ! zai jin shi de jue dui duo shu di ceng kai fa zhong , reng ran ji hu bei C wan quan long duan 。 zhe xie ling yu bao kuo cao zuo xi tong 、 qian ru shi xi tong 、 shu zi xin hao chu li deng 。 she qi C de jing ji ji chu da .net de gao ceng jian zhu shi zai shi wei xian 。    wo men zong shi yi wei zi ji ba wo le C, na me qing xie yi ge strcpy de biao zhun han shu 。 nin de da an ruo shi : void strcpy( char *strDest, char *strSrc ) {   while( (*strDest++ = * strSrc++) != ‘\0’ ); }    hen yi han , nin de cheng xu zhi neng na dao E。 kan kan na A de strcpy: char * strcpy( char *strDest, const char *strSrc ) {  assert( (strDest != NULL) && (strSrc != NULL) ); char *address = strDest;  while( (*strDest++ = * strSrc++) != ‘\0’ ); return address; }    zhe ge cheng xu kao lv le shen me ?   (1) cheng xu yao qiang da : wei le shi xian lian shi cao zuo , jiang mu de di zhi fan hui , han shu fan hui lei xing gai wei char *   (2) cheng xu yao ke du : yuan zi fu chuan zhi zhen shen shu jia const xian zhi , biao ming wei shu ru shen shu   (3) cheng xu yao jian zhuang : yan zheng strDest he strSrc fei kong    jia ru zhe san dian zhong nin zhi kao lv dao 0 dian huo 1 dian , na me qing hui jia hao hao xiu lian yi xia C。 yin wei zhe ge zui jian dan de strcpy yi yan zheng chu nin de C yu yan ji chu zhi neng jiao zuo “ ru men ”。    zai xie ge jian dan de strlen, zhe me xie jiu hao le : int strlen( const char *str ) // shu ru shen shu wei const { assert( strt != NULL ); // duan yan zi fu chuan di zhi fei 0 int len; while( (*str++) != '\0' ) { len++; } return len; }    you ci ke jian , xie hao zhe xie jian dan de han shu ye xu yao shen hou de ji ben gong , yong yuan bu yao fang qi dui ji ben gong de pei yang 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785325.html][img]http://image.wangchao.net.cn/it/1323423870118.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo (16)“ yu yan xue de yue duo yue hao ”    xu duo de chu xue zhe dou jing li guo zhe yang de yi ge jie duan , mian dui da liang de bian cheng yu yan he kai fa huan jing , ta men liang gan dao nan yi qu she , bu zhi dao zi ji jiu jing ying gai xue xi shen me 。 yu shi ta men shen me dou xue , jin tian kan yi xia Visual Basic, ming tian kan xue yi xia C++, hou tian zai shu dian kan dao le ben Java bian xin xue lai chao mai hui lai fan fan , da hou tian you fa xian bi xu xue .net le 。 ta men hen tong ku , shen me dou zai kan , jie guo shen me dou mei xue hui , mang mang lu lu er shou huo shen wei 。    wo men zhen de mei you bi yao zai shen me yu yan dou bu shen jing tong de qing kuang xia luan kan yi qi 。 ren zhun le yi zhong zhen zheng yu yan jiu ying gai jian chi bu xie di nu li 。 yin wei ren he yi men yu yan de ba wo dou fei yi chao yi xi yi shi , bi zhe cong liu nian qian kai shi jie chu C++, zhi dao xian zai , mei yi jie duan reng you xin de qi fa , zai xiang mu kai fa de guo cheng zhong ye bu duan you xin de shou huo 。 jin ri wo huan shi jue dui bu gan xuan cheng zi ji “ jing tong ” zhe men yu yan 。    xu duo gang bi ye de da xue sheng , dong bu dong jiu zai jian li shang xie shang zi ji jing tong yi dui yu yan 。 yu zhi xiang fan , da duo shu you xiu de gong cheng shi dou bu gan zhe me xie 。 ye xu , yan jiu yue shen , bian yue gan zi shen de wu zhi 。    zai xia ren wei , yi ge cheng shu de yu yan ti xi ying gai shi :    cheng xu yuan de yu yan ti xi = yi zhong hui bian + C + yi zhong mian xiang dui xiang (C++、JAVA、C# deng )    jia ru huan yao jia , na jiu jia yi zhong jie shi xing yu yan ,perl huo tcl( ye xu qi ta )。    yu yan ju you ji da de xiang si xing , cong C++ guo du dao JAVA zhi xu yao hen duan de yi duan shi jian 。 ge zhong yu yan de fa zhan li shi ye ti xian le bian cheng si xiang de fa zhan shi 。 wo men xue xi yi zhong yu yan , yu fa ye xu bing bu shi zui chong yao de , zui chong yao de shi wen cang zai yu fa wai biao xia de shen ceng te xing he she ji yong yi 。    ben hui shu zhe luo ci chu , geng duo cuo wu yu lu , dang ran shi dai xu 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785325.html][img]http://image.wangchao.net.cn/it/1323423870131.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti Java bian cheng kai fa shou ce zhuan ti , huo
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚秀气模特裴裴(8)
时尚秀气模特裴裴(7)
时尚秀气模特裴裴(6)
时尚秀气模特裴裴(5)
白墙黑瓦
广州东郊[原创]
八美至丹巴的东谷天然盆景
不一样的
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有