今天中午寫的,該程式是為我自己的電腦量身定做的,你可以把它改稱適合自己電腦的東西。http://fatmck.go.nease.net/opener.zipevery rights reserve to you!暈,那個空間流量有限制,我忘記了,只好把原始碼貼出來了。開發環境:VC++.NET 2003 / WinXp pro sp2////////////////////main.cpp///////////////////////////#include <windows.h>#
第六章講的是結構體,包括structure, union和bit-fields。除了介紹基本知識,作者在舉例子的時候牽扯了一些資料結構的知識,比如二叉樹、雜湊表等,學起來很有意思。這章的內容上大學學C語言時好像沒有作為重點,學得稀裡糊塗,出來之後才發覺很有用。第一節 結構體基本知識這節一個要注意的地方是,在結構體struct point { int x; int y;};的聲明中,point是可以省略的,作者管它叫structure
GNU C 的 __attribute__ 機制---------------------------------------------------------------- 原作者:afreez@sina.com 初次發布時間:2006-06-17 修改者:gates84@gmail.com----------------------------------------------------------------__attribute__
第五章講的是指標和數組。指標是C語言的精華,但同時也是最難和最容易混淆的地方。讀這一章真是如履薄冰,小心翼翼。從第一節到第十二節,難度依次增大,如果前面放過了一些不清楚的地方,到後面看到char (*(*x[3])())[5]這樣的東西就只有哭的力氣了。本章一開始作者就告訴了你指標是什麼,"A pointer is a variable that contains the address of a
第四章主題是函數和程式結構,內容越來越深入了,收穫也越來越大。我前面寫了一篇“程式應構思到什麼地步再開始寫”的文章,提到了程式的設計問題。本章4.1小節作者就給出了程式構思的例子。對於一個將輸入中包含特定字串的行列印出來的程式,作者把它分成了三部分:while (there's another line) if (the line contains the pattern) print it而這三部分都可以寫成獨立的函數。至於為什麼,作者說,"Three small
It is possible for a C program to print the currently executing line of source code, the file of the source code, and the name of the current function. The currently executing line is available in a preprocessor variable called__LINE__:#include
// ExceptionStudy.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>using namespace std;class CMyException{public:CMyException(void){cout << "CMyException constructor" <<