设为首页 加入收藏

TOP

Day 1:Introduction
2014-11-23 22:19:32 来源: 作者: 【 】 浏览:1
Tags:Day Introduction

1.1 Why use a language like C++


Conciseness
Maintainability
Portability
1.2 The compilation process

sorce file>>>Prcessed code>>>Object file

1.3 General notes on C++


case sensitive
2.1 hello world

Cpp代码
/*
* File: main.cpp
* Author: Gong Li
*
* Created on June 24, 2011, 9:18 PM
*/

#include

using namespace std;

/*
*
*/
int main() {
std::cout<<"Hello,world!";
return 0;
}

2.2 Tokens

keywords, identifiers,literals, operators, punctuation, whitespace

2.3 Explaination


comment: //.... or /*....*/
#include: the preprocessor dumping in the content of another file.
int main(){}: execute when the program starts up
cout <<: outputting some piece of text
namespaces: like std includes a group of idemntifiers
strings: Hello, world!
escape sequence:  ...
return 0: tell the OS it has completed successfully

3 Input

Input cin >> x

Output cout << "hello"

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇查找序列中的最大数和最小数 下一篇用c语言自制虚拟机框架

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: