易截截图软件、单文件、免安装、纯绿色、仅160KB

organizing code files in C & C++

http://www.gamedev.net/reference/programming/features/orgfiles/page2.asp
通过四个pitfall讲解头文件的由来和好处,以及使用头文件定义inline func and template.
Remember that, as far as the compiler is concerned, there is absolutely no difference between a header file and a source file.
The key idea is that headers contain the interface, and the source files contain the actual implementation.This means that one source file uses another source file via the second source file's header.
main body
By now you're probably convinced that there are benefits to splitting up your project into several smaller files. So, how would you go about it? Although some of the decisions you make will be reasonably arbitrary, there are some basic rules that you should follow to ensure that it all works.
Firstly, look at how you would split your code into sections. Often this is by splitting it into separate subsystems, or 'modules', such as sound, music, graphics, file handling, etc. Create new files with meaningful filenames so that you know at a glance what kind of code is in them. Then move all the code that belongs to that module into that file. Sometimes you don't have clear module - some would say this should send out warnings about the quality of your design! There may still be other criteria you use for splitting up code, such as the structures it operates upon. (Often "general purpose" functions can be split into string-handling and number-handling, for example.) And occasionally a module could be split into two or more files, because it might make sense to do so on logical grounds.
Once you have split it up in this way into separate source files, the next stage is to consider what will go into the header files. On a very simple level, code that you usually put at the top of the source file is a prime candidate for moving into a separate header file. This is presumably why they got termed 'header' files, after all.
This code to go in a header usually includes some or all


相关文档:

查找字符串中字符不重复的最大子串(C/C++)

 //输入参数:*str 搜索字符串
// subStrLen 用于返回找到的最大子字符串长度
//返回:找到的最大子字符串指针
char * findMaxSubStr(char *str, int &subStrLen){
char *subStr;
char *p = str;
int index[256] ;
for (int ix = 0; ix < sizeof(index)/sizeof(index[0]); ix++)
{
in ......

C/C++程序员应聘常见面试题深入剖析(转载)


1.引言
  本文的写作目的并不在于提供C/C++程序员求职面试指导,而旨在从技术上分析面试题的内涵。文中的大多数面试题来自各大论坛,部分试题解答也参考了网友的意见­。
许多面试题看似简单,却需要深厚的基本功才能给出完美的解答。企业要求面试者写一个最简单的strcpy函数都可看出面试者在技术上究竟达 ......

windows下C写服务基本框架

我将业务代码去掉了,只是用来搭个基本框架,用到的时候直接拿来用就可以了。(我这个是起一个socket)如果有什么建议请联系我。ChuangshengGuan@Gmail.com
main.c
Code:
#include "Services.h"
int main(int argc, char *argv[])
{
  SERVICE_TABLE_ENTRY ServiceTable[2];
 
  /* 指向表示服 ......

linux 下C、C++编程资料




GCC    中文手册   
     http://www.nbfan.com/forum/dispbbs....&ID=1433&page=1   
     GNU    make    指南   
     http:/ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号