程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> 關於C語言 >> Day 1:Introduction

Day 1:Introduction

編輯:關於C語言

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 <iostream> 
 
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"

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved