Advertisement
Tranvick

Example5

Jan 8th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. //Пример 5.Функции:
  2. //аргументы по умолчанию; результат функции?; использование перегруженной main
  3.  
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. void print_values(int a = 0, int b = 0, int c = 0) {
  9.     cout << a << " " << b << " " << c << endl;
  10. }
  11.  
  12. int main(int argv, char **argc) {
  13.     int x = 10, y = 20, z = 30;
  14.     print_values(x, y, z);
  15.     print_values(x, y);
  16.     print_values(x);
  17.     print_values();
  18.     cout << endl;
  19.     for (int i = 0; i < argv; ++i) cout << argc[i] << endl;
  20.     return 0;
  21. }
  22.  
  23. /*
  24. void main() {}
  25. int main() {
  26.     return 0;
  27. } */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement