2007年12月30日 星期日
2007年12月25日 星期二
Last Christmas
Last Christmas - Wham
Last Christmas I gave you my heart
But the very next day you gave it away
This year to save me from tears
I'll give it to someone special
Once bitten and twice shy
I keep my distance
But you still catch my eye
Tell me baby
Do you recognize me
Well it's been a year
It doesn't surprise me
(Happy Christmas)
I wrapped it up and sent it
With a note saying "I love you"
I meant it
Now I know what a fool I've been
But if you kissed me now
I know you'd fool me again
A crowded room
Friends with tired eyes
I'm hiding from you and your soul of ice
My god I thought you were someone to rely on me
I guess I was a shoulder to cry on
A face on a lover with a fire in his heart
A man under cover but you tore me apart
Now I've found a real love you'll never fool me again
A face on a lover with a fire in his heart
A man under cover but you tore him apart
Maybe next year I'll give it to someone
I'll give it to someone special
2007年12月23日 星期日
perror
每當程式執行時發生錯誤時,系統會將錯誤代碼寫入到外部的一個變數errno。透過這個變數可以得知更詳盡的錯誤訊息。然而代碼並不是human-readable,因此可以利用perror這個function來幫我們把代碼轉換成human-readable。
void perror(const char *s);
s,是加在錯誤訊息之前的一個字串,我們才知道是哪個地方發生錯誤。下面以嘗試開啟一個不存在的檔案來做說明:
int main() {
FILE *fptr;
if((fptr = fopen("nonexist.dat", "r")) == NULL)
{
perror("Errors");
return(0);
}
printf("No errors\n");
fclose(fptr);
return(0);
}
執行時,會產生以下的訊息
Errors: No such file or directory
2007年12月22日 星期六
冬至吃湯圓
2007年12月18日 星期二
神啊!請再多給我一些時間
半夜一點多,獨自走在中興校園裡,感覺格外冷清。
本想待在實驗室久一點的,但是休息是為了走更長遠的路,只好回宿舍去,睡實驗室總是不習慣。
看來星期三要將草稿交給老師有一些困難,神啊!請再多給我一些時間。
