The following is some accumulation and summary of learning and development in my past few years, welcome to discuss, welcome B4.
1. Books: Essential C : Getting Started, you can start writing C code The C Program Language: C father's work, no slightly, home travel must have a good book. C Primier: Very complete C work, but not recommended to get started reading, reference book. Effective C : Scott Meyers works, after a certain background, it can be referred to as skilled. More Effective C : Like the last article. Exceptional C : Herb SUTTER works, Scott Meyers students, foreign doctors are different. More Exceptional C : Like the last article. Modern C Design: Anders Alexandr works, one of the most admired Gods. Large-Scale C Software Design: If you need to participate in software for more than 200,000 row, it is recommended to read, otherwise you will continue to study the design mode.
2. Connect NewsGroup: Comp.lang.c : Ancient newsgroups need a proxy to access. If you are lazy as me, try news.gmane.org, you can use Outlook Express to browse. Cuj: Reading a good place to the parst papers, but the updates after 2002 have no fun. It is highly recommended "Generic
3. Code Base STL: C Standard Template Library, there are several versions, where SGI (GCC default) is mostly made, the VC6 is the most feet. BOOST: Very complete cross-platform C library, provides smart pointers, regular expressions, threads, string tool functions, etc. It took a long time that the website couldn't access it, but it can be accessed through the mirror of C-View. Loki: Anders Alexandr's code library, designed design, intelligent pointer, functor, typelist, etc. Qt: Originally a perfect C GUI library, but unfortunately paying copyright fees for business development, thousands of dollars, can't afford. Xerces: XML code base, estimated to be the best XML library except .NET Framework's system.xml, for C programmers, if a perfect XML Core Level3 support, cross-platform, free XML library, that is It's. However, the volume is not small. Xalan: XML XSLT Support Library, with XerCes, Apache's consistent tradition, large. TinyXML: If your XML only needs to support ANSI and UTF8 encoding, just do some simple XML resolution, TinyXML is a good choice, small and fine. ICU: IBM's Unicode implementation, two versions of Java and C / C, support various coding, internationalization, and localization functions, but it is very large, 8m. LIBICIONV: GNU's Unicode implementation, providing a variety of character sets to Unicode conversion function, about 1M. ACE: C network programming library, very perfect, easy to use, suitable for development servers. Provide network communication, message queue, thread / process pool, a variety of mutex / semaphore, and a set of server development frameworks, but there is no support for EPOLL. CURL: From the name, the CERL can be seen, and the library of the URL resource is perfectred to support HTTP, SHTTP, FTP and other protocols, which is better than Wininet, and there is a fight with WinHTTP in "Tobacco". FreeImage: Very complete image processing library, design is very good, support multiple image formats in plug-ins, and GIF except copyright issues. IT : Professional mathematics library. GC6.2: C garbage collector is very good. GCC comes with, Mono is also it. Libpdf: Generates a library of a PDF file, but unfortunately, you cannot read the editing PDF file. It's okay to go to www.sf.net to transfer, maybe there is any time.
4. Classic Topics: Smart Pointers in Boost: http://www.cuj.com/documents/s=8014/20204karlsson/ Scope Guard: http://www.cuj.com/documents/s=8000/cujcexp1812alexandr/alexandr .htm min max: http://www.c-view.org/journal/007/gp_aa.htm, this is translation.
5. Compiler difference: Mainly consider two compilers GCC and VC6, and some issues that should be noted in cross-platform cross-compiler code. 1. If you have different processing, routines and explanations of the const attribute of the VC6 and GCC to handle the temporary variable, please refer to here. 2. Differences in the expansion of the 64-bit integers of VC6 and GCC. VC uses __INT64, GCC uses long long. 3. Wchar_t under VC6 is 2 bytes, and Wchar_t is 4 bytes under GCC. 4. Many of the support for templates under VC6, causing many codes that cannot be compiled under VC6, detail, please refer to a simple list. 5. Use the __forceinline for the __forcenline to enforce the function for inline, Linux, but can be "strong" for the compiler with -finline-limit. 6. VC6 Use #pragma Comment (lib, libname) to static connection files, GCC, through -i and -l options, are Link library files in Link. 6. Personal view: Highly recommended Learning Standard C As a new language (http://www.research.att.com/~bs/new_learning.pdf), Bjarne Stroustrup's words, many people are just Converse C as a class C, for some basic concepts, such as copy construction, assignment, depth copy, template, multiple inheritance, virtual collection, etc., unreasonable, in the code BUG will come. Forgot the template. STL is very great, ATL is very good. But the template is really a double-edged sword, and the injured ten eight nine are yourself. Unless it is used for the design floor code, it is recommended to give up the use template because it has become difficult to maintain and debug the entire project. Yes, you may be familiar, there is no problem, but not everyone is a template master.
Only two reasons use macros. The first, in order to optimize the code. GCC does not force the inline method, resulting in the only way to ensure a feasible performance optimization. Second, in order to achieve some functions that do not have macro, such as connecting strings (with ##), read the current line number (__line__). In both cases, it is recommended not to use macros, especially do not use the macro macro, this code can only solve it. I have spent a year of time for work, I spent a year of 500,000 code lines, which is filled with various design and 50 rows. Yes, these macro did significantly reduce the code line of the entire software, but after discovering BUG, my only way is to re-expand these macros to the function, otherwise how to debug?
The project is tracking memory leakage and resource leakage, and it is best to implement some of the auxiliary code for tracking. I have realized one, if you are interested, you can refer to the discussion, connect it. Memory leaks can also use some tools, such as Bound Checker, other resources only rely on themselves.
For server software development, write log files is the best debugging method.
7. Tip: How to make a class can only be coming out of New, allocating in a heap? This is an accidental opportunity, and the result of a friend discussed, I didn't know why he would have this kind of demand, but the method did find it. Let you think about it, please see here.