PS:今天上午,非常郁闷,有很多简单基础的问题搞得我有些迷茫,哎,代码几天不写就忘。目前又不当COO,还是得用心记代码哦!
C++这个词在中国大陆的程序员圈子中平日被读做“C加加”,而东方的程序员平日读做“C plus plus”,“CPP”。 它是一种用使非常泛广的计算机编程语言。C++是一种静态数据类型检查的、支撑多重编程范式的通用程序设计语言。它支撑过程化程序设计、数据抽象、面向象对程序设计、泛型程序设计等多种程序设计风格。
在C的基础上,一九八三年又由尔贝实验室的Bjarne Strou-strup推出了C++。 C++进一步充扩和完善了C语言,成为一种面向 象对的程序设计语言。C++提出了一些更为入深的念概,它所支撑的这些面向象对的念概易容将问题间空直地接映射到程序间空,为程序员供给了一种与传统结构程序设计不同的思维方法和编程方法。因而也加增了个整语言的复杂性,把握起来有必定难度。
最初种这语言被称作“C with Classes”带类的C)。开始,C++是作为C语言的增强版现出的,从给C语言加增类开始,一直的加增新特性。虚函数(virtual function)、运算符重载(operator overloading)、多重继承(multiple inheritance)、板模(template)、常异(exception)、RTTI、命名间空(name space)逐步被入加标准。
1998年国际标准组织(international standard organization, ISO)公布了C++程序设计语言的国际标准ISO/IEC 1988-1998。C++是拥有国际标准的编程语言,平日称作ANSI/ISOC++。
经典书籍《C++ Primer》
/**************************************************************************/
IDE:code::Blocks
#include <iostream>
using namespace std;
/*Function*/
int addNumbers(int x, int y)
{
int sum = 0;
sum = x + y;
return sum;
}
/*Class*/
class iSwordClass
{
private:
string name;
string sex;
string telphone;
string qq;
string address;
public:
iSwordClass()
{
cout << "This is the constructor of iSwordClass. This will be created automatically....\n";
}
void setName(string _name)
{
name = _name;
}
string getName()
{
return name;
}
void setSex(string _sex)
{
sex = _sex;
}
string getSex()
{
return sex;
}
void coolSaying()
{
cout << "Cool iSword!\n";
}
};
int main()
{
//cout << addNumbers(100,200)<<endl;
int x;
int y;
cout << "Please input x:";
cin >> x;
cout << "Please input y:";
cin >> y;
cout << "The sum of x and y is : ";
cout << addNumbers(x,y)<<endl;
cout << "Begin to new a object of iSwordClass....\n";
iSwordClass isObject; // new a object
cout << "/*********Use the class function coolSaying...***********************/\n";
isObject.coolSaying();
cout << "/*********Use the class function setters, and getters... ************/\n";
isObject.setName("Jack");
isObject.setSex("Male");
cout << isObject.getName()<< endl;
cout << isObject.getSex()<<endl;
return 0;
}
文章结束给大家分享下程序员的一些笑话语录:
腾讯的动作好快,2010年3月5日19时28分58秒,QQ同时在线人数1亿!刚刚看到编辑发布的文章,相差才2分钟,然后连专题页面都做出来了,他们早就预料到了吧?(其实,每人赠送10Q币,轻轻松松上两亿!)