namespace的范圍?
#include?<stdlib.h> using?namespace?std; void?fun(int?i?=?30,?int?j?=?20,?int?k?=?10); int?main(){ ????????fun(); ????????fun(100); ????????fun(200); ????????fun(300); } void?fun(int?i,?int?j,?int?k) { ????????cout?<<?i?<<?","?<<?j?<<?","?<<?k?<<?endl; }
error: 'cout' was not declared in this scope
error: 'endl' was not declared in this scope
這是什么情況
2018-07-18
謝采納,
C++的標(biāo)準(zhǔn)輸入輸出庫的頭文件是iostream
使用它的方式為:
#include <iostream>
這行代碼放在頭文件下面。
以上。