Programing/C++

4. 디폴트 매개 변수.

akon47 2009. 6. 18. 22:13
반응형


#include <iostream>
int function(int a=0) { return a+1; } int main(void) { std::cout<<"function() call :"<<function()<<std::endl; std::cout<<"function(5) call :"<<function(5)<<std::endl; return 0; }
디폴트 매개 변수와, 함수의 오버로딩을 동시에 정의할때 조심.
 
반응형