Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C/C++³ÌÐòÔ±³£¼ûÃæÊÔÌâÉîÈëÆÊÎö


1.ÒýÑÔ   ±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº­¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û-¡£
 Ðí¶àÃæÊÔÌâ¿´ËƼòµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔÕßдһ¸ö×î¼òµ¥µÄstrcpyº¯Êý¶¼¿É¿´³öÃæÊÔÕßÔÚ¼¼ÊõÉϾ¿¾¹´ïµ½ÁËÔõÑùµÄ³Ì
¶È£¬ÎÒÃÇÄÜÕæÕýдºÃÒ»¸östrcpyº¯ÊýÂð£¿ÎÒÃǶ¼¾õµÃ×Ô¼ºÄÜ£¬¿ÉÊÇÎÒÃÇд³öµÄstrcpyºÜ¿ÉÄÜÖ»ÄÜÄõ½10·ÖÖеÄ2·Ö¡£¶ÁÕß¿É´Ó±¾ÎÄ¿´µ½strcpy
º¯Êý´Ó2·Öµ½10·Ö½â´ðµÄÀý×Ó£¬¿´¿´×Ô¼ºÊôÓÚʲôÑùµÄ²ã´Î¡£´ËÍ⣬»¹ÓÐһЩÃæÊÔÌ⿼²éÃæÊÔÕßÃô½ÝµÄ˼άÄÜÁ¦¡£
  ·ÖÎöÕâЩÃæÊÔÌ⣬±¾Éí°üº¬ºÜÇ¿µÄȤζÐÔ£»¶ø×÷ΪһÃûÑз¢ÈËÔ±£¬Í¨¹ý¶ÔÕâЩÃæÊÔÌâµÄÉîÈëÆÊÎöÔò¿É½øÒ»²½ÔöÇ¿×ÔÉíµÄÄÚ¹¦¡£
2.ÕÒ´íÌâ
  ÊÔÌâ1£º
void test1()
{
 char string[10];
 char* str1 = "0123456789";
 strcpy( string, str1 );   }
  ÊÔÌâ2£º
void test2()
{
 char string[10], str1[10];
 int i;
 for(i=0; i<10; i++)
 {   str1 = 'a'£»
 }
 strcpy( string, str1 )£»   }
  ÊÔÌâ3£º
void test3(char* str1)
{
 char string[10];
 if( strlen( str1 ) <= 10 )
 {
  strcpy( string, str1 );
 }
}
 ½â´ð£º
  ÊÔÌâ1×Ö·û´®str1ÐèÒª11¸ö×Ö½Ú²ÅÄÜ´æ·ÅÏ£¨°üÀ¨Ä©Î²µÄ'\0'£©£¬¶østringÖ»ÓÐ10¸ö×ֽڵĿռ䣬strcpy»áµ¼ÖÂÊý×éÔ½½ç£»  ¶ÔÊÔÌâ2£¬Èç¹ûÃæÊÔÕßÖ¸³ö×Ö·ûÊý×éstr1²»ÄÜÔÚÊý×éÄÚ½áÊø¿ÉÒÔ¸ø3·Ö£»Èç¹ûÃæÊÔÕßÖ¸³östrcpy(string,
str1)µ÷ÓÃʹµÃ´Óstr1ÄÚ´æÆð¸´ÖƵ½stringÄÚ´æÆðËù¸´ÖƵÄ×Ö½ÚÊý¾ßÓв»È·¶¨ÐÔ¿ÉÒÔ¸ø7·Ö£¬ÔÚ´Ë»ù´¡ÉÏÖ¸³ö¿âº¯Êýstrcpy¹¤×÷·½Ê½µÄ¸ø10
·Ö£»
  ¶ÔÊÔÌâ3£¬if(strlen(str1) <= 10)Ó¦¸ÄΪif(strlen(str1) <
10)£¬ÒòΪstrlenµÄ½á¹ûδͳ¼Æ'\0'ËùÕ¼ÓõÄ1¸ö×Ö½Ú¡£
  ÆÊÎö£º
  ¿¼²é¶Ô»ù±¾¹¦µÄÕÆÎÕ£º
  (1)×Ö·û´®ÒÔ'\0'½áβ£»
  (2)¶ÔÊý×éÔ½½ç°ÑÎÕµÄÃô¸Ð¶È£»
  (3)¿âº¯ÊýstrcpyµÄ¹¤×÷·½Ê½£¬Èç¹û±àдһ¸ö±ê×¼strcpyº¯ÊýµÄ×Ü·ÖֵΪ10£¬ÏÂÃæ¸ø³ö¼¸¸ö²»Í¬µÃ·ÖµÄ´ð°¸£º
  2·Ö
void strcpy( char *strDest, char *strSrc )
{
  while( (*strDest++ = * strSrc++) != '\0' );   }
&nbs


Ïà¹ØÎĵµ£º

¹ØÓÚC/C++ÔËÐÐÆÚ¿â


CÔËÐÐʱ¿âº¯ÊýºÍAPIº¯ÊýÓÐʲôÇø±ðºÍÁªÏµÄØ£¿
CÔËÐÐʱ¿âº¯ÊýÊÇÖ¸CÓïÑÔ±¾Ê¡Ö§³ÖµÄһЩ»ù±¾º¯Êý£¬Í¨³£ÊÇ»ã±àÖ±½ÓʵÏÖµÄ
¡£   
APIº¯ÊýÊDzÙ×÷ϵͳÌṩ¸øÓû§·½±ãÉè¼ÆÓ¦ÓóÌÐòµÄº¯Êý£¬ÊµÏÖһЩÌض¨µÄ¹¦ÄÜ£¬APIº¯ÊýÒ²ÊÇCÓïÑԵĺ¯Êý
ʵÏֵġ£
ËûÃÇÖ®¼äÇø±ðÊÇ£ºAPIº¯ÊýÊÇÕë¶Ô²Ù×÷ϵͳµÄ£¬CÓïÑÔÔËÐÐʱº¯ÊýÔòÊ ......

Linux C + + Training


Linux C + + Training
Syllabus
________________________________________
1, Linux Operating System
System Environment: Ubuntu GNU / Linux, RedHat Linux AS5,
FreeBSD
Course Requirements: proficient use of commonly used Linux
/ UNIX commands.
Time: 1 week.
______________________________ ......

VIM+GDB linux c/c++ µÄ±à³ÌÀûÆ÷

ÆäʵVIMÒ²ÄܰѱàÒë µ÷ÊÔ¼¯³ÉÔÚÒ»Æð£¬ÏñÊÇÒ»¸öIDEÒ»Ñù¡£
Ê×ÏÈÏÖÔÚVIMµÄÔ´Â룬ÒòΪҪ¼¯³Éµ÷ÊÔ»·¾³µÄ»°ÐèÒªÖØбàÒëVIM²ÅÐУ¬ËùÒÔÎÒÃDz»ÈçÖØа²×°Ò»¸ö¡£
VIMµÄÏÖÔÚµØÖ·£º
http://www.vim.org/sources.php
È»ºóÏÂÔØVIMGDB£¬ÕâÊÇvimµÄ¼¯³Éµ÷ÊÔ»·¾³µÄÒ»¸öÖØÒª²å¼þ³ÌÐò¡£
µØÖ·£ºhttp://sourceforge.net/projects/clewn/files ......

C/C++Í·ÎļþÒ»ÀÀ


C¡¢´«Í³ C++

#include <assert.h>¡¡¡¡¡¡¡¡
//É趨²åÈëµã
#include <ctype.h>¡¡¡¡¡¡¡¡
//×Ö·û´¦Àí
#include <errno.h>¡¡¡¡¡¡¡¡
//¶¨Òå´íÎóÂë
#include <float.h>¡¡¡¡¡¡¡¡
//¸¡µãÊý´¦Àí
#include <fstream.h>¡¡¡¡¡¡
//ÎļþÊäÈ룯Êä³ö
#include <iomanip.h>¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ