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

The C in C++

編輯:C++入門知識

1 unnamed arguments in the argument list of the function definition    (Page 114)

In c++, an argument may be unnamed in the argument list of the function definition. Since it is unnamed , you cannot use it in the function body, of course. Unnamed arguments are allowed to give the programmer a way to "." Whoever uses the function must still call the function with the proper arguments. However, the person creating the function can then that calls the function.

2 numbers of arguments       (Page 114)

2.1 an empty argument list

func():   In C++, it tells the compiler there are exactly .

     In C, it means an .

func(void):  In C and C++, it means an .

2.2 a variable argument list

func(...):  you should of variable argument lists in C and avoid them in C++.

3 Introduction to the pointers

Each of the elements in the program has a location in storage when the program is running. Even the function occupies storage.

4 Specifying storage allocation    (Page 147)

gloal variables,

local variables,

register variables(avoided),

(it is unavailable outside its definition scope, such as function scope or file scope. And you can define a function's local variable to be static and give it an initial value, the initialization is performed only the first time the function is call, and the data retains its value between function calls),

extern variables,

(a const must always hava an initialization value, and its value never change),

volatile variables(you will never know when this will change, and prevents the compiler from performing any optimizations based on the stability of that variable),

5 function address    (Page 198)

Once a function is compiled and loaded into the computer to be executed, it . Thus the funciton has an address.

When you are looking at a complex definition, the best way to attack it is to start in the middle and work your way out. middle->right->left->right->

 

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