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

C/C++——С±à̸CÓïÑÔº¯ÊýÄÇЩÊÂ(22)

C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
 
1.    setmemº¯Êý
setmemº¯ÊýµÄ¹¦ÄÜÊÇ´æÖµµ½´æ´¢Çø£¬ÆäÓ÷¨Îª£ºvoid setmem(void *addr, int len, char value);³ÌÐòʵÀýÈçÏ£º
#include <stdio.h>
#include <alloc.h>
#include <mem.h>
int main(void)
{
   char *dest;
   dest = calloc(21, sizeof(char));
   setmem(dest, 20, 'c');
   printf("%s\n", dest);
   return 0;
}
 2.   setmodeº¯Êý
setmodeº¯ÊýµÄ¹¦ÄÜÊÇÉèÖôò¿ªÎļþ·½Ê½£¬ÆäÓ÷¨Îªint setmode(int handle, unsigned mode);³ÌÐòʵÀý´úÂëÈçÏ£º
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
int main(void)
{
   int result;
   result = setmode(fileno(stdprn), O_TEXT);
   if (result == -1)
      perror("Mode not available\n");
   else
      printf("Mode successfully switched\n");
   return 0;
}
3.    setpaletteº¯Êý
setpaletteº¯ÊýµÄ¹¦ÄÜÊǸıäµ÷É«°åµÄÑÕÉ«, ÆäÓ÷¨Îª£ºvoid far setpalette(int index, int actural_color);³ÌÐòʵÀý´úÂëÈçÏ£º
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
   int gdriver = DETECT, gmode, errorcode;
   int color, maxcolor, ht;
   int y = 10;
   char msg[80];
   initgraph(&gdriver, &gmode, "");
   errorcode = graphresult();
   if (errorcode != grOk) 
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1);
   }
   maxcolor = getmaxcolor();
   ht = 2 * textheight("W");
&nbs


Ïà¹ØÎĵµ£º

c/sÍøÂç½á¹¹

 ²ÉÓÃc/s ¿Í»§¶ËºÍ·þÎñ¶Ëģʽ½øÐÐÎļþºÍÃüÁîÊý¾ÝµÄ´«Ê䣬ÒÔ¼°Êý¾ÝµÄ½»»»¡£c/s ºÍb/s p2pµÈ¶àÖÖ¼¼ÊõÏë½áºÏ¡£
Ò»£¬cs ÍøÂçµÄʵÏÖ
²ÉÓô«Í³µÄ¿Í»§¶ËºÍ·þÎñ¶Ëģʽ£¬ÓÃtcp/ip ЭÒé½øÐÐÊý¾ÝµÄ½»»¥ºÍ´«µÝ¡£
¶þ£¬csÍøÂ翪·¢
Ä£·ÂÖøÃûµÄ»Ò¸ë×ÓÈí¼þ£¬»Ò¸ë×ӵĵ½À´£¬¸øÍøÂçÊÀ½ç£¬´øÀ´ÁËеĻîÁ¦£¬¸øÈËÃÇ´øÀ´ÐµÄÌåÑ飬
ºÍ¹ÛÄ ......

[ËæÏë]C/C++³ÌÐòÔ±

       ¸Õ¸Õ¿´¹ýÕâƪ¡¶30 years of C¡·£¬»ØÏëÁËÕ⼸ÄêµÄѧϰÀú³Ì¡£
      ÔÚ´óѧÀÎÒѧϰµÄµÚÒ»ÃųÌÐòÉè¼ÆÓïÑÔÊÇC£¬µ«»¨Ê±¼ä×î¶àµÄ»¹ÊÇC++¡£´óÔ¼ÎåÄêÇ°£¬¿ªÊ¼¿Ð¡¶ C++±à³Ì˼Ïë¡·Á½¾í±¾£¬ÓÃDev-cppÔÚ»úÆ÷Á·Ï°×ÅÊéÉϵÄÒ»¸ö¸öÀý×Ó³ÌÐò£¬Ö®ºóÓÖѧϰÁËÃæÏò¶ÔÏó±à³Ì¡¢STL¡¢Ä£°å¡£Æ¾×Å ......

C/C++Öеİ´Öµµ÷ÓÃÓë°´ÒýÓõ÷ÓÃ

 Ðí¶à±à³ÌÓïÑÔÖеĵ÷Óú¯ÊýµÄÁ½ÖÖ·½·¨ÊÇ°´Öµµ÷ÓÃ(call-by-value)ºÍ°´ÒýÓõ÷ÓÃ(call-by-reference)¡£
²ÎÊý°´Öµµ÷Óô«µÝʱ£¬Éú³É²ÎÊýÖµ¸±±¾²¢ÇÒ´«¸ø±»µ÷Óú¯Êý£¬¸±±¾µÄ¸Ä±ä²¢²»Ó°Ïìµ÷ÓÃÕßµÄԭʼ±äÁ¿Öµ£¬ÕâÑù¾Í¿ÉÒÔ·ÀÖ¹ÒâÍâµÄ¸±×÷ÓÃÓ°Ï쿪·¢ÕýÈ·£¬¿É¿¿µÄϵͳ¡£°´Öµµ÷ÓõÄÒ»¸öȱµãÊÇ£¬Èç¹û´«µÝ½Ï´óµÄÊý¾ÝÏÔò¸´ÖÆÕâ¸öÊý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ