星期一, 9月 26, 2005

Hitech C Compiler for PIC

一些奇怪的行為:

const char 和 char不能比較:

bit samestr(char *data,const char *cstr)
{
if(data[i]==cstr[i]){
.....

這樣不行,要先宣告一個local variable,再取出constr的內容

char temp;

temp=cstr[i];
if(data[i]==temp({
....

這樣才可以

沒有留言:

網誌存檔