[LOOK] 请教C++文件结构问题——把类封装在一个文件中

[复制链接]
 楼主| gdmgb520 发表于 2011-9-28 23:11 | 显示全部楼层 |阅读模式
本帖最后由 gdmgb520 于 2011-9-29 05:47 编辑

目的:把tft类从led.cpp中分离。
问题:建立tft.cpp和tft.h,在led.cpp中创建tft对象,调用构造函数出现问题。编译报错。


tft.h
  1. //#if LOOK_H == 0
  2. //#include "NUC1xx.h"
  3. //#include "NUC1xxM051Seriescfg.h"
  4. //#else
  5. //#define __HAVE_GPIO
  6. //#include <nuc120re3an.h>
  7. //using namespace nuvoton;
  8. //#endif
  9. #ifndef TFT_H
  10. #define TFT_H

  11. #include "look_config.h"
  12. #include <look.h>

  13. #define __HAVE_GPIO
  14. #include <nuc120re3an.h>
  15. using namespace nuvoton;

  16. #include "asc.H"

  17. #define RS        14          //
  18. #define CS        15          //

  19. #define WR        6          //
  20. #define RD        7          //

  21. extern unsigned int color[];
  22. extern unsigned int POINT_COLOR;//默认红色   


  23. // 任务类 task_tft_t 的定义
  24. class task_tft_t : public task_t {
  25. public:
  26.         __INLINE__ task_tft_t();        // 构造函数
  27.         //task_tft_t();        // 构造函数

  28. private:
  29.         void Io_Set(unsigned char pin);           //单个IO口置位函数
  30.         void Io_Clr(unsigned char pin);           //单个IO口清零函数
  31.         void OUT_DATA(unsigned char data);
  32.         void delay(unsigned int i);           //延时
  33.         void delayms (unsigned int i);
  34.         void LCD_WDATA(unsigned char data);         //写入8位数据
  35.         //写8位数据函数
  36.         void LCD_WR_DATA1(unsigned char data);
  37.         //写寄存器地址函数
  38.         void LCD_WR_REG(unsigned char data);
  39.         //写16位数据函数
  40.         void LCD_WR_DATA_BYTE(unsigned char DataH,unsigned char DataL);
  41.         //写16位数据函数
  42.         void LCD_WR_DATA(unsigned int val);
  43.         void LCD_WR_COM( unsigned int com);               
  44.         void LCD_WR_COM_DATA( int com1,int dat1);
  45.         void LCD_SET_LOCATION(unsigned int i,unsigned int j);        //设置X、Y坐标,做好写RAM的准备
  46.         
  47. public:        
  48.         //清屏函数   
  49.         //x,y:起始坐标
  50.         //len,wid:长宽
  51.         void LCD_CLEAR(unsigned char x,unsigned int y,unsigned char len,unsigned int wid);
  52.         //在指定位置显示一个字符
  53.         //x:0~234
  54.         //y:0~308
  55.         //num:要显示的字符:" "--->"~"
  56.         void LCD_ShowChar(unsigned char x,unsigned int y,unsigned char num);
  57.         //显示字符串
  58.         //x,y:起点坐标  
  59.         //*p:字符串起始地址
  60.         void LCD_ShowString(unsigned char x,unsigned int y,const char *p);
  61.         //初始化函数
  62.         void LCD_Init(void);
  63.         //显示
  64.         void LCD_Display(void);
  65. };

  66. #endif
tft.cpp
  1. #include "tft.h"

  2. unsigned int color[]={0xf8,0x00,0x07,0xe0,0x00,0x1f,0xff,0xe0,0x00,0x00,0xff,0xff,0x07,0xff,0xf8,0x1f};
  3. unsigned int POINT_COLOR=0XF800;//默认红色   

  4. //--------  类task_tft_t成员函数定义 -------------------------------
  5. //类 task_tft_t 的构造函数
  6. __INLINE__ task_tft_t::task_tft_t()
  7. {
  8.         // TODO: 在此初始化 task_led3_t 的类成员
  9. }
  10. void task_tft_t::Io_Set(unsigned char pin)           //单个IO口置位函数
  11. {
  12.         unsigned int io_data=1;
  13.         io_data=io_data<<pin;
  14.         //LPC_GPIO0 -> FIOSET=io_data;         //IOSET0为IO线上置位寄存器,1有效,0无
  15.         GPIOC.DOUT = GPIOC.DOUT | io_data;
  16. }
  17. void task_tft_t::Io_Clr(unsigned char pin)           //单个IO口清零函数
  18. {
  19.         unsigned int io_data=1;
  20.         io_data=io_data<<pin;
  21.         //LPC_GPIO0 -> FIOCLR=io_data;         //IOCLR0为IO线上清零寄存器,1有效,0无
  22.         GPIOC.DOUT = GPIOC.DOUT & (~io_data);
  23. }

  24. void task_tft_t::OUT_DATA(unsigned char data)
  25. {
  26.         unsigned int k;
  27.         k=data;
  28.         GPIOA.DOUT=k<<2;
  29. }



  30. //延时
  31. void task_tft_t::delay(unsigned int i)
  32. {
  33.         unsigned int k=10;
  34.         i=i+2;
  35.         while(i>0)
  36.         {
  37.                 i--;
  38.         }
  39.         while(k>1)k--;
  40. }


  41. void task_tft_t::delayms (unsigned int i)
  42. {
  43.         unsigned int n;
  44.         while(i>1)
  45.         {
  46.                 for(n=65535;n>1;n--);
  47.                 i--;
  48.         }
  49. }

  50. //写入8位数据
  51. void task_tft_t:CD_WDATA(unsigned char data)
  52. {   
  53.         Io_Clr(CS);

  54.         OUT_DATA(data);

  55.         Io_Clr(WR);

  56.         Io_Set(WR);

  57.         Io_Set(CS);

  58.         Io_Clr(RS);

  59. }  
  60. //写8位数据函数
  61. void task_tft_t:CD_WR_DATA1(unsigned char data)
  62. {
  63.         Io_Set(RS);;//写数据  
  64.         LCD_WDATA(data);
  65. }
  66. //写寄存器地址函数
  67. void task_tft_t:CD_WR_REG(unsigned char data)
  68. {
  69.         Io_Clr(RS);//写地址
  70.         LCD_WDATA(data);
  71. }  
  72. //写16位数据函数
  73. void task_tft_t:CD_WR_DATA_BYTE(unsigned char DataH,unsigned char DataL)
  74. {  
  75.    Io_Set(RS);//A0=1;
  76.         Io_Clr(CS);
  77.          OUT_DATA(DataH);//DPTR=DH;                                                
  78.   
  79.         Io_Clr(WR);
  80.         Io_Set(WR);
  81.         OUT_DATA(DataL);//P3=DPL;        
  82.                                        
  83.         Io_Clr(WR);
  84.         Io_Set(WR);
  85.         Io_Set(CS);        
  86. }
  87. //写16位数据函数
  88. void task_tft_t:CD_WR_DATA(unsigned int val)
  89. {  
  90.    Io_Set(RS);//A0=1;
  91.         Io_Clr(CS);
  92.          OUT_DATA(val>>8);//DPTR=DH;                                                
  93.   
  94.         Io_Clr(WR);
  95.         Io_Set(WR);
  96.         OUT_DATA(val);//P3=DPL;        
  97.                                        
  98.         Io_Clr(WR);
  99.         Io_Set(WR);
  100.         Io_Set(CS);        
  101. }


  102. void task_tft_t:CD_WR_COM( unsigned int com)               
  103. {        
  104.     Io_Clr(RS);
  105.         Io_Clr(CS);        
  106.    OUT_DATA(com>>8);//        DPTR=CH;                                
  107. //        P3=DPH;        
  108.    Io_Clr(WR);
  109.         Io_Set(WR);
  110.         OUT_DATA(com);//P3=DPL;               
  111.         Io_Clr(WR);
  112.         Io_Set(WR);
  113.         Io_Set(CS);        
  114. }

  115. void task_tft_t:CD_WR_COM_DATA( int com1,int dat1)
  116. {
  117.    LCD_WR_COM(com1);
  118.    LCD_WR_DATA(dat1);
  119.    
  120. }

  121. void task_tft_t:CD_SET_LOCATION(unsigned int i,unsigned int j)                //设置X、Y坐标,做好写RAM的准备
  122. {
  123.     LCD_WR_COM_DATA(0x0020,0);//设置X坐标位置
  124.     LCD_WR_COM_DATA(0x0021,0);//设置Y坐标位置
  125.     LCD_WR_COM(0x0022);                                //指向RAM寄存器,准备写数据到RAM
  126. }

  127. //清屏函数   
  128. //x,y:起始坐标
  129. //len,wid:长宽
  130. void task_tft_t:CD_CLEAR(unsigned char x,unsigned int y,unsigned char len,unsigned int wid)
  131. {                    
  132.     unsigned long n,temp;
  133.     LCD_WR_COM_DATA(0x0020,0);//设置X坐标位置
  134.     LCD_WR_COM_DATA(0x0021,0);//设置Y坐标位置
  135.     LCD_WR_COM(0x0022);                                //指向RAM寄存器,准备写数据到RAM
  136.         temp=(unsigned long)len*wid;   
  137.         for(n=0;n<temp;n++)LCD_WR_DATA(0xffff);//显示白色
  138. }
  139. //在指定位置显示一个字符
  140. //x:0~234
  141. //y:0~308
  142. //num:要显示的字符:" "--->"~"

  143. void task_tft_t:CD_ShowChar(unsigned char x,unsigned int y,unsigned char num)
  144. {      
  145. #define MAX_CHAR_POSX 234
  146. #define MAX_CHAR_POSY 308
  147.     unsigned char temp;
  148.     unsigned char pos,t;      
  149.     if(x>MAX_CHAR_POSX||y>MAX_CHAR_POSY)return;
  150.     //设定一个字符所占的大小
  151.     //开辟空间
  152. //        LCD_WR_CMD(0,0x2,x);//
  153. //        LCD_WR_CMD(1,0x3,y);
  154. //        LCD_WR_CMD(0,0x04,x+5);        //结束列数(0~239)        
  155. //        LCD_WR_CMD(1,0x05,y+11);//结束行数(0~319)   
  156. //        LCD_WR_REG(0x0E);  
  157.    LCD_WR_COM_DATA(0x0020,x);//设置X坐标位置
  158.     LCD_WR_COM_DATA(0x0021,y);//设置Y坐标位置

  159.         LCD_WR_COM_DATA(0x0050, x); // Horizontal GRAM Start Address
  160.         LCD_WR_COM_DATA(0x0052, y); // Vertical GRAM Start Address  
  161.         LCD_WR_COM_DATA(0x0051, x+5); // Horizontal GRAM End Address      
  162.         LCD_WR_COM_DATA(0x0053, y+11); // Vertical GRAM end Address

  163.     LCD_WR_COM(0x0022);                                //指向RAM寄存器,准备写数据到RAM
  164.          
  165.         num=num-' ';//得到偏移后的值
  166.         for(pos=0;pos<12;pos++)
  167.         {
  168.             temp=asc2[num][pos];
  169.             for(t=0;t<6;t++)
  170.             {                 
  171.                 if(temp&0x01)LCD_WR_DATA(POINT_COLOR);
  172.                 else LCD_WR_DATA(0xffff);//白色   
  173.                 temp>>=1;
  174.             }
  175.         }
  176.         LCD_WR_COM_DATA(0x0050, 0x0000); // Horizontal GRAM Start Address
  177.         LCD_WR_COM_DATA(0x0051, 0x00EF); // Horizontal GRAM End Address
  178.         LCD_WR_COM_DATA(0x0052, 0x0000); // Vertical GRAM Start Address
  179.         LCD_WR_COM_DATA(0x0053, 0x013F); // Vertical GRAM Start Address
  180. }
  181.                                                          
  182. //显示字符串
  183. //x,y:起点坐标  
  184. //*p:字符串起始地址
  185. void task_tft_t:CD_ShowString(unsigned char x,unsigned int y,const char *p)
  186. {         
  187.     while(*p!='\0')
  188.     {      
  189.         if(x>MAX_CHAR_POSX){x=0;y+=12;}
  190.         if(y>MAX_CHAR_POSY){y=x=0;LCD_CLEAR(0,0,240,320);}
  191.         LCD_ShowChar(x,y,*p);
  192.         x+=6;
  193.         p++;
  194.     }  
  195. }         
  196. //初始化函数
  197. void task_tft_t:CD_Init(void)
  198. {      
  199.             //液晶接口初始化   
  200.                
  201.         //        LCD_RST = 0;//硬件复位
  202.         //        delay_ms(200);
  203.         //        LCD_RST = 1;
  204.         //        delay_ms(200);
  205.                 //initializing funciton 1
  206.         //************* Start Initial Sequence **********//
  207.         LCD_WR_COM_DATA(0x0001, 0x0100); // set SS and SM bit
  208.         //LCD_WR_COM_DATA(0x0001, 0x0000); // set SS and SM bit
  209.         LCD_WR_COM_DATA(0x0002, 0x0700); // set 1 line inversion
  210.         LCD_WR_COM_DATA(0x0003, 0x1030); // set GRAM write direction and BGR=1.
  211.         LCD_WR_COM_DATA(0x0004, 0x0000); // Resize register
  212.         LCD_WR_COM_DATA(0x0008, 0x0202); // set the back porch and front porch
  213.         LCD_WR_COM_DATA(0x0009, 0x0000); // set non-display area refresh cycle ISC[3:0]
  214.         LCD_WR_COM_DATA(0x000A, 0x0000); // FMARK function
  215.         LCD_WR_COM_DATA(0x000C, 0x0000); // RGB interface setting
  216.         LCD_WR_COM_DATA(0x000D, 0x0000); // Frame marker Position
  217.         LCD_WR_COM_DATA(0x000F, 0x0000); // RGB interface polarity
  218.         //*************Power On sequence ****************//
  219.         LCD_WR_COM_DATA(0x0010, 0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB
  220.         LCD_WR_COM_DATA(0x0011, 0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
  221.         LCD_WR_COM_DATA(0x0012, 0x0000); // VREG1OUT voltage
  222.         LCD_WR_COM_DATA(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
  223.         LCD_WR_COM_DATA(0x0007, 0x0001);
  224.         delay(60); // Dis-charge capacitor power voltage
  225.         LCD_WR_COM_DATA(0x0010, 0x1690); // SAP, BT[3:0], AP, DSTB, SLP, STB
  226.         LCD_WR_COM_DATA(0x0011, 0x0227); // R11h=0x0221 at VCI=3.3V, DC1[2:0], DC0[2:0], VC[2:0]
  227.         delay(50); // Delay 50ms
  228.         LCD_WR_COM_DATA(0x0012, 0x001A); // External reference voltage= Vci;
  229.         delay(50); // Delay 50ms
  230.         LCD_WR_COM_DATA(0x0013, 0x1400); // R13=1200 when R12=009D;VDV[4:0] for VCOM amplitude
  231.         LCD_WR_COM_DATA(0x0029, 0x0024); // R29=000C when R12=009D;VCM[5:0] for VCOMH
  232.         LCD_WR_COM_DATA(0x002B, 0x000C); // Frame Rate
  233.         delay(50); // Delay 50ms
  234.         LCD_WR_COM_DATA(0x0020, 0x0000); // GRAM horizontal Address
  235.         LCD_WR_COM_DATA(0x0021, 0x0000); // GRAM Vertical Address
  236.         // ----------- Adjust the Gamma Curve ----------//
  237.         LCD_WR_COM_DATA(0x0030, 0x0007);
  238.         LCD_WR_COM_DATA(0x0031, 0x0604);
  239.         LCD_WR_COM_DATA(0x0032, 0x0007);
  240.         LCD_WR_COM_DATA(0x0035, 0x0504);
  241.         LCD_WR_COM_DATA(0x0036, 0x0808);
  242.         LCD_WR_COM_DATA(0x0037, 0x0007);
  243.         LCD_WR_COM_DATA(0x0038, 0x0301);
  244.         LCD_WR_COM_DATA(0x0039, 0x0007);
  245.         LCD_WR_COM_DATA(0x003C, 0x0302);
  246.         LCD_WR_COM_DATA(0x003D, 0x0808);
  247.         //------------------ Set GRAM area ---------------//
  248.         LCD_WR_COM_DATA(0x0050, 0x0000); // Horizontal GRAM Start Address
  249.         LCD_WR_COM_DATA(0x0051, 0x00EF); // Horizontal GRAM End Address
  250.         LCD_WR_COM_DATA(0x0052, 0x0000); // Vertical GRAM Start Address
  251.         LCD_WR_COM_DATA(0x0053, 0x013F); // Vertical GRAM Start Address
  252.         LCD_WR_COM_DATA(0x0060, 0xA700); // Gate Scan Line
  253.         LCD_WR_COM_DATA(0x0061, 0x0001); // NDL,VLE, REV
  254.         LCD_WR_COM_DATA(0x006A, 0x0000); // set scrolling line
  255.         //-------------- Partial Display Control ---------//
  256.         LCD_WR_COM_DATA(0x0080, 0x0000);
  257.         LCD_WR_COM_DATA(0x0081, 0x0000);
  258.         LCD_WR_COM_DATA(0x0082, 0x0000);
  259.         LCD_WR_COM_DATA(0x0083, 0x0000);
  260.         LCD_WR_COM_DATA(0x0084, 0x0000);
  261.         LCD_WR_COM_DATA(0x0085, 0x0000);
  262.         //-------------- Panel Control -------------------//
  263.         LCD_WR_COM_DATA(0x0090, 0x0010);
  264.         LCD_WR_COM_DATA(0x0092, 0x0600);
  265.         LCD_WR_COM_DATA(0x0007, 0x0133); // 262K color and display ON
  266. }
  267. //显示测试
  268. void task_tft_t:CD_Display(void)
  269. {
  270.     POINT_COLOR=0xf100;//画笔颜色
  271.     LCD_ShowString(50,100,"This is a test for TFTLCD!");
  272. }
led.h
  1. #include "look_config.h"
  2. #include <look.h>
  3. //#include <instantiate>

  4. // 任务类 task_led1_t 的定义
  5. class task_led1_t : public task_t {
  6. public:
  7.         __INLINE__ task_led1_t();        // 构造函数
  8.         
  9. protected:
  10.         void routine();                // 任务例程
  11. };

  12. // 任务类 task_led1_t 的构造函数
  13. __INLINE__ task_led1_t::task_led1_t()
  14. {
  15.         // TODO: 在此初始化 task_led1_t 的类成员
  16. }

  17. //extern instantiate::task<task_led1_t, LOOK_STACK_SIZE> task_led1;

  18. // 任务类 task_led2_t 的定义
  19. class task_led2_t : public task_t {
  20. public:
  21.         __INLINE__ task_led2_t();        // 构造函数
  22.         
  23. protected:
  24.         void routine();                // 任务例程
  25. };

  26. // 任务类 task_led2_t 的构造函数
  27. __INLINE__ task_led2_t::task_led2_t()
  28. {
  29.         // TODO: 在此初始化 task_led2_t 的类成员
  30. }


  31. extern instantiate::task<task_led1_t, LOOK_STACK_SIZE> task_led1;
  32. extern instantiate::task<task_led2_t, LOOK_STACK_SIZE> task_led2;
led.cpp
  1. #include "led.h"

  2. #define LOOK_H 1

  3. #if LOOK_H == 0
  4. #include "NUC1xx.h"
  5. #include "NUC1xxM051Seriescfg.h"
  6. #else
  7. #define __HAVE_GPIO
  8. #include <nuc120re3an.h>
  9. using namespace nuvoton;
  10. #endif

  11. #include "tft.h"

  12. task_tft_t tftObj;                //创建tft对象


  13. //-------------------------------------------------------------------------------------------------------------------------
  14. //                         类task_led3_t相关定义
  15. //-------------------------------------------------------------------------------------------------------------------------
  16. // 任务类 task_led3_t 的定义
  17. class task_led3_t : public task_t {
  18. public:
  19.         __INLINE__ task_led3_t();        // 构造函数
  20.         
  21. public:
  22.         void led_off(void);
  23. };

  24. // 任务类 task_led3_t 的构造函数
  25. __INLINE__ task_led3_t::task_led3_t()
  26. {
  27.         // TODO: 在此初始化 task_led3_t 的类成员
  28. }

  29. void task_led3_t::led_off(void)
  30. {
  31.         static uint32_t data = 0b100;
  32.         GPIOA.DMASK(-1)
  33.                  .DMASK2(0);
  34.     GPIOA.DOUT = data;
  35.         data ^= 0b100;
  36. }

  37. task_led3_t led3;         //创建对象

  38. //-------------------------------------------------------------------------------------------------------------------------
  39. //               
  40. //-------------------------------------------------------------------------------------------------------------------------
  41. // 任务类 task_led_t 的例程
  42. void task_led1_t::routine()
  43. {
  44.         // TODO: 在此编写 task_led_t 例程的内容
  45.         uint32_t data = ~0b1000;
  46.         
  47.         tftObj.LCD_Init();
  48. //        test_lcd_mon();
  49.         tftObj.LCD_CLEAR(0,0,240,320);
  50.          while (true) {
  51.                 // TODO: 在此编写 task_led_t 例程的内容
  52.                 tftObj.LCD_Display();
  53. //
  54. //                data &= 0b111000;
  55. //                data <<= 1;
  56. //                data += data >> 3;
  57. //#if LOOK_H == 0
  58. //                GPIOAs.DMASK.Regs = ~0b111000;
  59. //                GPIOAs.DOUT.Regs = data;
  60. //#else
  61. //                GPIOA.DMASK(-1)
  62. //                     .DMASK5(0)
  63. //                         .DMASK4(0)
  64. //                         .DMASK3(0);
  65. //            GPIOA.DOUT = data;
  66. //#endif
  67.                 delay(LOOK_TICKS_PER_SEC / 2);
  68. //                led3.led_off();

  69.          }
  70. }
  71. // 任务类 task_led_t 的例程
  72. void task_led2_t::routine()
  73. {
  74.         // TODO: 在此编写 task_led_t 例程的内容
  75.         uint32_t data = 0b100;
  76.          while (true) {
  77.                 // TODO: 在此编写 task_led_t 例程的内容
  78. #if LOOK_H == 0
  79.                 GPIOAs.DMASK.Regs = ~0b100;
  80.                 GPIOAs.DOUT.Regs = data;
  81. #else
  82.                 GPIOA.DMASK(-1)
  83.                          .DMASK2(0);
  84.             GPIOA.DOUT = data;
  85. #endif
  86.                 data ^= 0b100;
  87.                 delay(LOOK_TICKS_PER_SEC / 10);
  88.          }
  89. }



  90. #ifdef LOOK_SCHEDULING_PRIORITY
  91. instantiate::task<task_led1_t, LOOK_STACK_SIZE> task_led1(0);
  92. instantiate::task<task_led2_t, LOOK_STACK_SIZE> task_led2(0);
  93. #else
  94. instantiate::task<task_led1_t, LOOK_STACK_SIZE> task_led1;
  95. //instantiate::task<task_led2_t, LOOK_STACK_SIZE> task_led2;
  96. //instantiate::task<task_led3_t, LOOK_STACK_SIZE> task_led3;
  97. #endif
工程文件

谢谢大家!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| gdmgb520 发表于 2011-9-28 23:14 | 显示全部楼层
抱歉,工程中有些不必要的代码没有删掉!
john_lee 发表于 2011-9-29 00:38 | 显示全部楼层
很浅显的错误。 楼主在tft.h中定义了task_tft_t类,并且有inline的构造函数声明:
  1. __INLINE__ task_tft_t();        // 构造函数

但没有在这个头文件中定义构造函数的函数体(function body)。

然后,楼主在led.cpp中创建了task_tft_t类的实例:
  1. task_tft_t tftObj;                //创建tft对象


编译器在编译led.cpp时,发现了task_tft_t类的实例tftObj,并且通过头文件知道task_tft_t类有一个inline的构造函数,但是,却没有找到这个函数的函数体。所以,编译器报错:function body not available。

这个函数体在什么地方?原来楼主把它写在了tft.cpp文件中。

楼主,明白问题在哪里了吗?
 楼主| gdmgb520 发表于 2011-9-29 05:45 | 显示全部楼层
3# john_lee

谢谢lee老师。老师睡得这么晚。

把 task_tft_t类的构造函数从tft.cpp中剪切到tft.h中,编译成功。

原因分析:(请lee老师看看是否正确)
“在CPP中,名称有内部链接和外部链接之别。对于外部链接,如函数定义,因为它可以在其他文件中使用,所以不能允许在程序中重复定义,因此它不能放在头文件中。对于内部链接,如,类型定义、枚举定义、全局常量定义、inline函数和模板定义等,因为他们只能在自己的程序文件使用,故可以跨文件重复定义。”
——《C++程序设计教程》
Swallow_0322 发表于 2011-9-29 08:10 | 显示全部楼层
Lee老师讲的够细致,受教了!
也需要向gdmgb520学习!
 楼主| gdmgb520 发表于 2011-9-29 12:48 | 显示全部楼层
谢谢鼓励
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:了解新东西才知道自己的不足。 www.elecbench.com

67

主题

452

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部