第 8 章 函數探索.pptVIP

  • 2
  • 0
  • 约1.01万字
  • 约 25页
  • 2019-10-30 发布于湖北
  • 举报
第8章 函數探索 列表 8-1 inline.cpp:行內函數 行內函數 vs. 巨集指令 列表 8-4 swaps.cpp:參考值與函數參數 列表8-7 left.cpp:引數內定值 列表8-8 leftover.cpp:函數同名異式(多載) 列表8-9 funtemp.cpp:函數樣板(template) 列表8-10 twotemps.cpp:多載樣板 儲存類別、範圍和連結 列表8-17 static.cpp:區域static變數 問題回顧 程式設計練習(一) 、(二) 列表 8-1 inline.cpp:行內函數 #include iostream.h // an inline function must be defined before first use inline double square(double x) { return x * x; } int main(void) { double a, b; double c = 13.0; a = square(5.0); b = square(4.5 + 7.5); // can pass expressions cout a = a , b = b \n; cout c = c; cout , c squared = square(c++) \n; cout N

文档评论(0)

1亿VIP精品文档

相关文档