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

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

C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæÐ¡±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1.       dellineº¯Êý
dellineº¯ÊýµÄ¹¦ÄÜÊÇÔÚÎı¾´°¿ÚÖÐɾȥһÐУ¬ÆäÓ÷¨Îª£ºvoid delline(void);³ÌÐòÀý×ÓÈçÏ£º
#include <conio.h>
int main(void)
{
   clrscr();
   cprintf("The function DELLINE deletes \
    the line containing the\r\n");
   cprintf("cursor and moves all lines \
    below it one line up.\r\n");
   cprintf("DELLINE operates within the \
    currently active text\r\n");
   cprintf("window.  Press any key to \
    continue . . .");
   gotoxy(1,2);  /* Move the cursor to the
      second line and first column */
   getch();
   delline();
   getch();
   return 0;
}
2.       detectgraphº¯Êý
detectgraphº¯ÊýµÄ¹¦ÄÜÊÇͨ¹ý¼ì²âÓ²¼þÈ·¶¨Í¼ÐÎÇý¶¯³ÌÐòºÍģʽ£¬ÆäÓ÷¨Îª£ºvoid far detectgraph(int far *graphdriver, int far *graphmode); ³ÌÐòÀý×ÓÈçÏ£º
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
/* names of the various cards supported */
char *dname[] = { "requests detection",
    "a CGA",
    "an MCGA",
    "an EGA",
    "a 64K EGA",
    "a monochrome EGA",
    "an IBM 8514",
    "a Hercules monochrome",
    "an AT&T 6300 PC",
    "a VGA",
    "an IBM 3270 PC"
  };
int main(void)
{
   /* returns detected hardware info. */
   int gdriver, gmode, errorcode;
  /* detect graphics hardware available */
   detectgraph(&gdriver, &gmode);
   /* read result of detectgraph call */


Ïà¹ØÎĵµ£º

C/C++ Newbie's FAQ

 
Part I ÈçºÎÉÏ·
1. vi, vimÊDZàÒëÆ÷ô£¿
vi means visual editor£¬ÊÇÈí¼þÊÀ½çµÚÒ»¸öÈ«ÆÁÄ»±à¼­Æ÷£¬×î³õµÄ×÷ÕßÊÇÏÖÔÚSun microsystemµÄBill Joy¡£
vim means Vi IMproved£¬¿ÉÒÔ¿´×÷ÊÇÔöÇ¿µÄvi¡£
ºÜ²»ÐÒ£¬ËûÃǶ¼²»ÊDZàÒëÆ÷£¬Èç¹ûÄãÒѾ­Ð´ºÃÁËfirst.c£¬ÄÇô²»ÄÜÖ¸ÍûviÃǽ«ÄãµÄÔ´´úÂë±ä³ÉÖ´ÐгÌÐò¡£
2. gcc, ......

²âÊÔ¶ÔCµÄÕÆÎճ̶È

 
ÏÂÃæÕâ¸ö³ÌÐòÊä³öʲô£¿
enum {false,true};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 15)
continue;
}while(false);
return 0;
}
ÄãÏàÐÅô£¿ÏÂà ......

´ÓÁ½µÀ¾­µäÊÔÌâ̸C/C++ÖÐÁªºÏÌ壨union£©µÄʹÓÃ


´ÓÁ½µÀ¾­µäÊÔÌâ̸C/C++ÖÐÁªºÏÌ壨union£©µÄʹÓÃ
ÊÔÌâÒ»£º±àдһ¶Î³ÌÐòÅжÏϵͳÖеÄCPUÊÇLittle endian»¹ÊÇBig endianģʽ£¿
·ÖÎö£º
×÷Ϊһ¸ö¼ÆËã»úÏà¹Ø×¨ÒµµÄÈË£¬ÎÒÃÇÓ¦¸ÃÔÚ¼ÆËã»ú×é³ÉÖж¼Ñ§Ï°¹ýʲô½ÐLittle endianºÍBig endian¡£Little endianºÍBig endianÊÇCPU´æ·ÅÊý¾ÝµÄÁ½ÖÖ²»Í¬Ë³Ðò¡£¶ÔÓÚÕûÐÍ¡¢³¤ÕûÐ͵ÈÊý¾ÝÀàÐÍ£ ......

C/C++ ³£¼ûÃæÊÔÌâ

 
1.Ö¸ÕëºÍÒýÓÃÓÐʲô·Ö±ð£»Èç¹û´«ÒýÓñȴ«Ö¸Õ밲ȫ£¬ÎªÊ²Ã´£¿Èç¹ûÎÒʹÓó£Á¿Ö¸ÕëÄѵÀ²»ÐÐÂð£¿
     (1) ÒýÓÃÔÚ´´½¨µÄͬʱ±ØÐë³õʼ»¯£¬¼´ÒýÓõ½Ò»¸öÓÐЧµÄ¶ÔÏó£»¶øÖ¸ÕëÔÚ¶¨ÒåµÄʱºò²»±Ø³õʼ»¯£¬¿ÉÒÔÔÚ¶¨ÒåºóÃæµÄÈκεط½ÖØÐ¸³Öµ£®
     (2) ²»´æÔڣΣգ̣ÌÒýÓã¬ÒýÓÃ±Ø ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ