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

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

 
1.Ö¸ÕëºÍÒýÓÃÓÐʲô·Ö±ð£»Èç¹û´«ÒýÓñȴ«Ö¸Õ밲ȫ£¬ÎªÊ²Ã´£¿Èç¹ûÎÒʹÓó£Á¿Ö¸ÕëÄѵÀ²»ÐÐÂð£¿
     (1) ÒýÓÃÔÚ´´½¨µÄͬʱ±ØÐë³õʼ»¯£¬¼´ÒýÓõ½Ò»¸öÓÐЧµÄ¶ÔÏó£»¶øÖ¸ÕëÔÚ¶¨ÒåµÄʱºò²»±Ø³õʼ»¯£¬¿ÉÒÔÔÚ¶¨ÒåºóÃæµÄÈκεط½ÖØÐ¸³Öµ£®
     (2) ²»´æÔڣΣգ̣ÌÒýÓã¬ÒýÓñØÐëÓëºÏ·¨µÄ´æ´¢µ¥Ôª¹ØÁª;¶øÖ¸ÕëÔò¿ÉÒÔÊÇNULL.
     (3) ÒýÓÃÒ»µ©±»³õʼ»¯ÎªÖ¸ÏòÒ»¸ö¶ÔÏó£¬Ëü¾Í²»Äܱ»¸Ä±äΪÁíÒ»¸ö¶ÔÏóµÄÒýÓã»¶øÖ¸ÕëÔÚÈκÎʱºò¶¼¿ÉÒԸıäΪָÏòÁíÒ»¸ö¶ÔÏó£®
¸øÒýÓø³Öµ²¢²»ÊǸıäËüºÍԭʼ¶ÔÏóµÄ°ó¶¨¹ØÏµ£®
     (4) ÒýÓõĴ´½¨ºÍÏú»Ù²¢²»»áµ÷ÓÃÀàµÄ¿½±´¹¹Ô캯Êý
     (5) ÓïÑÔ²ãÃæ£¬ÒýÓõÄÓ÷¨ºÍ¶ÔÏóÒ»Ñù£»ÔÚ¶þ½øÖƲãÃæ£¬ÒýÓÃÒ»°ã¶¼ÊÇͨ¹ýÖ¸ÕëÀ´ÊµÏֵģ¬Ö»²»¹ý±àÒëÆ÷°ïÎÒÃÇÍê³ÉÁËת»».
     ²»´æÔÚ¿ÕÒýÓ㬲¢ÇÒÒýÓÃÒ»µ©±»³õʼ»¯ÎªÖ¸ÏòÒ»¸ö¶ÔÏó£¬Ëü¾Í²»Äܱ»¸Ä±äΪÁíÒ»¸ö¶ÔÏóµÄÒýÓã¬ÏԵúܰ²È«¡£
     const Ö¸ÕëÈÔÈ»´æÔÚ¿ÕÖ¸Õ룬²¢ÇÒÓпÉÄܲúÉúÒ°Ö¸Õë.
     ×ܵÄÀ´Ëµ£ºÒýÓüȾßÓÐÖ¸ÕëµÄЧÂÊ£¬ÓÖ¾ßÓбäÁ¿Ê¹Óõķ½±ãÐÔºÍÖ±¹ÛÐÔ£®
2.¹¹Ô캯Êý¿É·ñÊÇÐ麹Êý£¬ÎªÊ²Ã´£¿Îö¹¹º¯ÊýÄØ£¬¿É·ñÊÇ´¿ÐéµÄÄØ£¿
     ¹¹Ô캯Êý²»ÄÜΪÐ麯Êý£¬Òª¹¹ÔìÒ»¸ö¶ÔÏ󣬱ØÐëÇå³þµØÖªµÀÒª¹¹Ôìʲô£¬·ñÔòÎÞ·¨¹¹ÔìÒ»¸ö¶ÔÏó¡£
     Îö¹¹º¯Êý¿ÉÒÔΪ´¿Ð麯Êý¡£
3.ΪʲôҪÒýÈë³éÏó»ùÀàºÍ´¿Ð麯Êý£¿
     Ö÷ҪĿµÄÊÇΪÁËʵÏÖÒ»ÖÖ½Ó¿ÚµÄЧ¹û¡£
4. ½á¹¹ÓëÁªºÏÓкÍÇø±ð£¿
(1). ½á¹¹ºÍÁªºÏ¶¼ÊÇÓɶà¸ö²»Í¬µÄÊý¾ÝÀàÐͳÉÔ±×é³É, µ«ÔÚÈκÎͬһʱ¿Ì, ÁªºÏÖÐÖ»´æ·ÅÁËÒ»¸ö±»Ñ¡ÖеijÉÔ±£¨ËùÓгÉÔ±¹²ÓÃÒ»¿éµØÖ·¿Õ¼ä£©,
¶ø½á¹¹µÄËùÓгÉÔ±¶¼´æÔÚ£¨²»Í¬³ÉÔ±µÄ´æ·ÅµØÖ·²»Í¬£©¡£
(2). ¶ÔÓÚÁªºÏµÄ²»Í¬³ÉÔ±¸³Öµ, ½«»á¶ÔÆäËü³ÉÔ±ÖØÐ´, Ô­À´³ÉÔ±µÄÖµ¾Í²»´æÔÚÁË, ¶ø¶ÔÓڽṹµÄ²»Í¬³ÉÔ±¸³ÖµÊÇ»¥²»Ó°ÏìµÄ¡£
5. #include<file.h> Óë #include "file.h"µÄÇø±ð£¿
´ð£º ǰÕßÊÇ´ÓStandard LibraryµÄ·¾¶Ñ°ÕÒºÍÒýÓÃfile.h£¬¶øºóÕßÊÇ´Óµ±Ç°¹¤×÷·¾¶ËÑѰ²¢ÒýÓÃfile.h, Èç¹ûºóÕßûÓÐÕÒµ½¶ÔÓ¦µÄÎļþ£¬¾Í°´Ç°Õߵķ¾¶È¥Ñ°ÕÒ¡£
6. ÃæÏò¶ÔÏóµÄÈý¸ö»ù±¾ÌØÕ÷£¬²¢¼òµ¥ÐðÊöÖ®£¿
   (1). ·â×°£º½«¿Í¹ÛÊÂÎï³éÏó³ÉÀ࣬ÿ¸öÀà¶Ô×ÔÉíµÄÊý¾ÝºÍ·½·¨Êµ


Ïà¹ØÎĵµ£º

µÚÁùÕ´𰸠c primer plus

 6.1 ±àдһ¸ö³ÌÐò,´´½¨Ò»¸ö¾ßÓÐ26¸öÔªËØµÄÊý×é,²¢ÔÚÆäÖд洢26¸öСд×Öĸ,²¢ÈøóÌÐòÏÔʾ¸ÃÊý×éµÄÄÚÈÝ.
#include <stdio.h>
int main(void)
{
 char a[26] = {'a', 'b', 'c', 'd', 'e', 'f',
     'g', 'h', 'i', 'j', 'k', 'l',
     'm', 'n', 'o', 'p ......

CÖкê#ºÍ##µÄÔËÓÃ

 #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#define f(a,b) a##b
#define g(a)  #a
#define h(a) g(a)
int main()   
{   
    char a = 'a';      
    ......

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


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

CÌâÄ¿2

Ô¤´¦ÀíÆ÷£¨Preprocessor£©
1. ÓÃÔ¤´¦ÀíÖ¸Áî#define ÉùÃ÷Ò»¸ö³£Êý£¬ÓÃÒÔ±íÃ÷1ÄêÖÐÓжàÉÙÃ루ºöÂÔÈòÄêÎÊÌ⣩
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)UL
ÎÒÔÚÕâÏë¿´µ½¼¸¼þÊÂÇ飺
1). #define Óï·¨µÄ»ù±¾ÖªÊ¶£¨ÀýÈ磺²»ÄÜÒԷֺŽáÊø£¬À¨ºÅµÄʹÓ㬵ȵȣ©
2). ¶®µÃÔ¤´¦ÀíÆ÷½«ÎªÄã¼ÆËã³£Êý±í´ïʽµÄÖµ£¬Òò´Ë£¬Ö±½Ó ......

Á´±íµÄ»ù±¾²Ù×÷(cʵÏÖ£©

  
Á´±í¶¨Òå¼°²Ù×÷µÄÔ´Îļþ£ºemployee.h
//
#pragma once
#ifndef __EMPLOYEE_H__
#define __EMPLOYEE_H__
#include<stdio.h>
#include<malloc.h>
typedef struct employee{
int id;
int age;
int salary;
}EmpType;
typedef struct Node{
EmpType data;
struct Node *next;
}L ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ