Week Overview(1124)

  
float型參數不能直接傳入數值,否則編譯器不能判斷它是double型還是float型
Write(string section , string key , float value)
Write(“Infor”,”Name”, 0.1);      //error
應傳入float型變量
float p=0.1;
Write(“Infor”,”Name”, p);       //correct
 
子類不能用指針
SMConfig * m_config;
m_config=new SMConfig;
class SMConfig
{
       template<class T>
       class SectionWriter
       {
       }
}
 
m_config->SectionWriter<MAPS::value_type>(f); //error
SMConfig:: SectionWriter<MAPS::value_type>(f); //correct
 
free(buf)後buf!=NULL
 
不能直接把字符串常量賦值給char *
char * buf;
buf=(char *)malloc(256);
buf=”abc”;                //error, buf不是const char *,所以不能這樣賦值
 
char * buf;
buf=(char *)malloc(256);
memcpy(buf,”abc”,3);
*(buf+3)=0          //0等於’/0’, 表示buf結尾,否則打印buf將打印abc及其後面的亂碼
 
EA的用法
Project->Version Control->Work Offline
project view, 雙擊main, 右鍵check out,就可在本地改動文件了
畫箭頭:選中testcase的方框,再選中tool box中custom下 Dependency,從testcase方框內拖到函數方框內
畫diagram frame: 右鍵 Insert element at cursor->diagram frame
把函數從Class Model模塊下拖到Test Model模塊下
toolbox下 custom->testcase, 右鍵 Advanced Settings->use rectangle notation
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章