#include <iostream> using namespace std; void method(int a, int b) { int aa = a; int bb = b; cout << "aa:" << aa << " bb:" << bb << endl; } void defaultParaMethod(int a = 0, int b = 1) { int aa = a; int bb = b; cout << "aa:" << aa << " bb:" << bb << endl; } int main() { int A = 1; int B = 2; defaultParaMethod(A); defaultParaMethod(A, B); //method(a); // error return 0; }
No comments:
Post a Comment