China Naming Network - Ziwei Dou Shu - Which company produces c++?

Which company produces c++?

C language is named "C" because of the second letter of "BCPL" (the first letter is used to name the previously invented B language). At the peak of the development of C language, a version called C with class appeared, which is the earliest version of C++. At that time, many versions of C wanted to add the concept of class to the C language. Later, the C Standards Committee decided to give this version of C a new name. Many names were collected at that time, and one of them was finally adopted. Using the++operator in C language is the progress of C language, so it is called C++, and the C++ standard committee was established. At&T Company. Dr bjarne stroustrup of Bell Laboratories invented and realized C++ (originally called "C with Classes") in the early 1980s. At the beginning, C++ appeared as an enhanced version of C language. Since the C language added classes, new features have been added continuously. Virtual functions, operator overloading, multiple inheritance, templates, exceptions, RTTI and namespaces are gradually added to the standard. 1998 the international organization for standards (ISO) issued the international standard of C++ programming language ISO/IEC 1988- 1998. C++ is a programming language with international standards, usually called ANSI/ISO C++. 1998 is the first year of the establishment of the C++ Standards Committee, and the standards will be updated every five years according to actual needs. The next standard update was originally scheduled for 2009. At present, we generally call the standard C++ 0x. However, due to the fierce controversy over the new features, it is complete except for the new modification in the technical report 1 (TR 1). What's more, due to the complexity and long-term evolution of C++ language, until now (20 10), no compiler has fully met this standard.

Edit the components of this paragraph.

According to the first clause of the valid third edition of C++, C++ now consists of the following four "sublanguages": 1 and C sublanguage. C++ supports almost all the functions of C language, mainly the part of c89, which is only slightly different from C language in grammar (for example, the left and right values of bracket expressions, please refer to the C++ standard literature for details). 2. Object-oriented C++ language. Originally, C++ language has no object-oriented design function. However, with the concept of object-oriented programming and the development of Java and other languages, C++ language has also developed a version that supports object-oriented functions. 3. Universal programming language. The powerful (but easily out of control) template function of C++ enables it to complete a lot of work at compile time, thus greatly improving the efficiency of runtime. 4.STL(C++ standard template library). With the continuous development of STL, it has gradually become an indispensable part of C++ programming, and its efficiency may be lower than that of ordinary native code, but its security and standardization make it popular. In addition, the new functions of C++0x contained in TR 1 are being developed and tested.

Edit this paragraph language development

The development of C++ language can be roughly divided into three stages: the first stage is from 1980s to 1995. At present, C++ language is basically a traditional object-oriented language, which occupies a considerable share in the development languages used in the industry with the efficiency close to that of C language. The second stage is 1995 to 2000. At this stage, due to the appearance of standard template library (STL) and later Boost library, generic programming occupies an increasing proportion in C++. Of course, at the same time, due to the appearance of Java, C# and other languages and the large-scale decline in hardware prices, C++ has suffered a certain impact; In the third stage, since 2000, C++ has reached a new peak in the development history due to the emergence of production programming and template metaprogramming represented by Loki, MPL and other libraries. The emergence of these new technologies and their integration with the original technologies make C++ the most complex member of the mainstream programming language.

Edit this introductory book.

C++ is a language, and its grammar, features and standard class library are already very advanced courses, so when you start learning, you should first lay a good foundation. There are many books about Visual C++ on the market. Although it may take 1-2 chapters to introduce the basic features of C++, it will definitely not get you started. Therefore, beginners should choose books in C++ language itself instead of books in Visual C++, MFC or Windows API. Learning C++ should be easy to difficult and step by step. It used to be said that you should learn C first and then C++. Actually, that's not necessary. Although C++ and C are related, they are still two different languages. Of course, it is very beneficial to learn other programming languages before learning C++. That will make learning C++ faster. After all, many concepts of computer language are interlinked. For beginners with zero foundation, calm down and don't be impatient. It is not so easy to become a master of C++, and it takes a lot of effort. From the choice of introductory textbooks, it mainly depends on the learners' own situation. If you have experience in learning advanced languages, C++ programming in Tan Haoqiang is recommended. Note that it was published in 2004, and the book published in 2006 was castrated, and it was object-oriented when it came up. Although C and C++ are similar, as mentioned earlier, C and C++ should be studied as two languages, so the content of the book in 2006 is slightly lacking. Tan Haoqiang's 04 edition of this book is very regular and well organized. If you have the foundation of other high-level languages, it is estimated that you will have a general understanding of C++ in half a year. Teacher Tan Haoqiang's book has become the teaching material of universities all over the country, which is relatively recognized. If you are learning C++ from scratch, I recommend Pan Jiajie's easy-to-learn C++. This book was published in 2008. I heard that it was written by a student when he was studying. There is a free electronic version of this book that can be downloaded online. This book is mainly aimed at beginners, but also lively and interesting, which can improve learning interest. Therefore, for beginners who have no foundation, it is beneficial to choose this book. Even if you want to become a master soon, reading this book may not be enough. As for reading introductory books, you should read some advanced books. take for example

Edit the design principles of this paragraph.

C++ is designed as a static multi-purpose programming language, which is as efficient and portable as C. c++ is designed to directly and widely support various programming styles (programmatic programming, data abstraction, object-oriented programming and generic programming). C++ is designed to give programmers more choices, even if it may lead to the wrong choice of programmers. C++ is designed to be as compatible as possible with C, thus providing a smooth transition from C to C++. C++ avoids platform limitations or general features. C++ does not use features that will bring extra overhead. The design of c++ has no complicated programming environment. In order to keep the language simple and efficient, many features of C++ are provided in libraries (such as STL) or other forms, and are not directly added to the language itself. On this topic, the father of C++ made a detailed statement in Design and Evolution of C++ Language. Hello world program

When using a compiler compatible with the C89 standard (also known as ANSI C), the following program displays "Hello, world!" Then end the operation:

(Actually, this is not a C++ program that conforms to the 98 standard [ISO C++], and it can't run on most compilers. If you want to compile this program on an old compiler, you should change stdio.h to iostream.h).

# include & ltstdio.h & gt

int main()

{

Printf ("Hello, world! \ n ");

Returns 0;

}

(The above is C language code, and c++ language is a higher version of C language. )

When using a compiler compatible with the C++98 standard (ISO/IEC14882-1998), the following process is also possible:

# include & ltiostream.h & gt

int main()

{

Cout & lt& lt "Hello, world!" & lt& ltendl

Returns 0;

}

When using a compiler compatible with C++ STL, it should be:

# include & ltiostream & gt

Use namespace std

int main()

{

Cout & lt& lt "Hello, world!" & lt& ltendl

Returns 0;

}

According to ISO C++, the main function can only be

int main(void)

{

...

}

and

int main(int argc,char * argv[])

{

...

}

Nevertheless, on the Microsoft Visual Studio compiler before Visual C++ 2003,

void main()

{

...

}

It is also supported, but it is not correct or standard. This writing will make the program code lose its cross-platform characteristics. Every year, professionals prescribe the grammar of C++, which is one of the reasons why C++ is superior to other programming languages. Java from c++ has become a popular programming language.

Edit the code performance of this paragraph.

Generally speaking, the development cost of using Java or C# is lower than C++. However, if you can fully analyze the differences between C++ and these languages, you will find that this sentence is conditional. This condition is that the software scale and complexity are relatively small. If it does not exceed 30,000 lines of valid code (excluding the code generated by the generator), this sentence can basically be established. Otherwise, with the increase of code volume and complexity, the advantages of C++ will become more and more obvious. What causes this difference is the software engineering of C++. When Java and C# talk about software engineering, C++ has actually quietly raised software engineering to an unprecedented height. This is ignored by most people and tried to be covered up by big companies. The quality of language in software engineering depends on its abstract ability. From process-oriented to object-oriented, the abstract ability of language has made a qualitative leap, but in practice, people find that object-oriented can not solve all the problems in software engineering. Therefore, elites gradually introduce and expand generic programming to solve higher-level software engineering problems. In fact, the origin of object-oriented and generic programming can be traced back to 1967, but the application of generic programming lags far behind object-oriented.

Edit this application sample.

Which programs are written in C++: The Windows kernels of the three major operating systems are written in C language and assembly, and the upper advanced features are written in C++. Almost all online games, such as World of Warcraft and Baidu search engine, most of the software we use is written in C++ (many hardware also uses C++). Here are some C++ applications: Amazon: software for large-scale e-commerce; Apple: OS x is written in mixed languages, but several important parts are C++ (of course, the core part is assembly and C language). at & amp; T: The largest telecommunications provider in the United States. O supply system o rapid network recovery system after failure Autodesk:CAD large number of major applications in CAD field Ericsson: o server platform. Otma-CDMA HLR GSM-TDMA-CDMA mobile gateway Google: Web search engine, etc. HP: The following are a small part of HP C++ applications: o C, C++, Fortran90 compiler, and linker for the new HP IA64 platform (these add more than1million lines of C++ code). IBM: o OS/400。 O K42: A high-performance, open-source and universal operating system kernel for caching consistent multiprocessors. Compiler and optimizer of Intel: vtune performance analysis software O chip design and manufacturing software JPL (NASA Jet Propulsion Laboratory) O Rover autopilot system (including scene analysis and path planning). C++ on mars There are also many "on the ground" (that is, the earth) supporting software. Microsoft: o Windows XP o Windows NT (NT4 and 2000) o Windows 9x (95, 98, Me) o Microsoft Office (Word, Excel, Access, PowerPoint, Outlook). O Internet Explorer (including outlook express) o visual studio o SQL Mozilla: Firefox browser and Thunderbird mail client (open source) MySQL: MySQL Server (about 250,000 lines of C++) and MySQL Cluster. It can be said that it is the most popular open source database in the world: Nokia: o mobile communication radio station/Internet bridge: FlexiGGSN (gateway GPRS support node) and FlexiSGSN (server GPRS support node). O MSC/ HLR Sun: O Hotspot Java Virtual Machine is written in C++ Symbian OS. Basic principle: "[...] Use C++ for all system codes, starting with the kernel." This is one of the most extensive mobile phone operating systems, and KDE from linux is written in C++. Telephone system: I think it is almost easy for software written in c++ to list systems that are not written in c++. C++ also includes VLC, a famous open source video player; LAMMPS, a famous molecular dynamics simulation software, includes some Fortran codes;

Editing this paragraph programming skills

Dynamic memory allocation and release using new and delete

Operators new and delete are new operators in C++, which provide the function of dynamically allocating and releasing storage. Its function is equivalent to malloc () and free () functions of C language, but its performance is better. Compared with malloc (), using new has the following advantages: (1)new automatically calculates the sizeof of the type to be allocated, which is more convenient and can avoid mistakes. (2) Automatically return the correct pointer type without forcing pointer type conversion. (3) You can initialize the allocated object with new. Use example: (1) int * p; p = new int[ 10]; //Assign an integer array of 10 integer delete [] p; ; //Delete this array (2) int * p; p = new int( 100); //Dynamically assign an integer and initialize it.

Use inline functions instead of macro calls

For frequently used functions, C language suggests using macro call instead of function call to speed up code execution and reduce call overhead. However, macro calling has many shortcomings, which may have unexpected side effects. For example, macro: # defineabs (a) (a) < 0? (-a):(a) When using abs(i++), this macro will make an error. Therefore, inline function should be used instead of macro call in C++, which can not only achieve the purpose of macro call, but also avoid the disadvantages of macro call. To use an inline function, just put the inline keyword before the return type of the function. For example: inline int Add(int a, int b); //Declare Add () as an inline function, so that when the compiler encounters the Add () function, it will not make any function calls, but directly embed the function code to speed up the execution of the program.

Using function overloading

In C language, the names of two functions cannot be the same, otherwise it will lead to compilation errors. In C++, two functions with the same function name but different parameter data types are interpreted as overloading. For example: Void put Hz (char * str); //Output Chinese character void PutHz(int x,? int y,? char * str); //Input numbers in x, y and use function overloading, which can help programmers to deal with more complicated problems and avoid using complicated function names such as intabs (), fabs () and dabs (); At the same time, in large programs, function names are easy to manage and use, and you don't have to rack your brains to deal with function names. At the same time, it must be noted that the data types of parameters are the same, but functions with different return types of two functions cannot be overloaded.

Use references instead of pointers to pass parameters.

In C language, if a function needs to modify the variable value used as a parameter, then the parameter should be declared as a pointer type. For example: void add (int * a) {(* a)++; } use add (&; x); //where x is int or a type that can be converted into int, such as unsigned int, but the compiler will usually give a warning at this time. For complex programs, it is easy to make mistakes when using pointers, and the program is difficult to read. In C++, you can use references instead of pointers to make the program clearer and easier to understand. A reference is an alias for a variable. Operations on references are equivalent to operations on original variables. For example, a function that uses a reference is defined as void add(int & amp; a){ a++; //a is an integer reference} Use add (x) when calling; //where x is int, this function has the same function as the previous function using pointers, but the code is more concise and clear.

Use default parameters

In C++, the function can use default parameters, such as void puthzxy (char * str, int x =- 1, int y =-1) {if (x =-1) x = where x (); if(y = =- 1)x = where x(); moveto(x,y); PutHx(str); } There are three ways to call the function PutHzxy (), such as: puthzxy ("C++language"); //Output PutHzxy("C++ language ",10,10) at the current position using the default parameters; //Do not use the default parameter PutHzxy("C++ language ",10); //Use the default parameter of y to specify the position of X. Usually, a function should be as flexible as possible. Using default parameters provides an effective way for programmers to deal with more complex and flexible problems, so default parameters are widely used in C++ code. It should be noted that all default parameters must appear to the right of non-default parameters. In other words, once the default parameters are defined, non-default parameters can no longer be described. Otherwise, when you omit one of the parameters, the compiler will not know whether you have customized the parameter or defined a non-default parameter with the default parameter. For example: Void Puthzxy (char * str, int x =- 1, int y =- 1)// Correct Void Puthzxy (int x =- 1, int y =- 1, char * str)//.

Using STL

STL (standard template library), the code of STL can be roughly divided into three categories: algorithm, container and iterator, including some tools such as auto_ptr. Almost all code uses template classes and template functions, which provides a better opportunity for code reuse compared with the traditional library composed of functions and classes. # include & ltvector & gt// contains related header files /typedefstd:: vector.

Edit the development mode of this paragraph.

In the unix world, a large number of programmers develop software in the traditional non-IDE way. The general combination is as follows: 1. Compilers: gcc, clang, etc. 2. Edit: vim/emacs 3.make:gnu make or bsd's pmake, etc. The function and usage are basically the same. 4. Version management: cvs, svn, git, etc. 5. code reading: cscope, ctags, lxr, etc.

Edit this development environment

1.Visual Studio(Visual C++) 2。 Borland C++ Builder 3。 Eclipse(Myln + CDT + Mingw32 + GCC) 4。 Dev-C++(Mingw32 + GCC) 5。 Code::Blocks (can be used with multiple compilation cores) 6. Code 7. C-Free As shown above, the popular GNU GCC and Microsoft's Visual Studio series each have a basic compilation chain, and other ide are derivative products.