Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <stdio.h>
  7.  
  8. using namespace std;
  9.  
  10.  
  11. int sum(int a[]) {
  12. return a[0] + a[1];
  13. }
  14.  
  15. int sumaab(int a, int b) {
  16. return a + b;
  17. }
  18.  
  19. int main(int argc, int b)
  20. {
  21.  
  22.  
  23. //cout << main(2,5) << endl; // 1 mas variantas su main Neteisingai stack'ą overflowina
  24. cout << sumaab(3, 5) << endl; //Teisingai
  25.  
  26. //Neteisingai
  27. int a[] = { 1}; // truksta argumento
  28.  
  29. //Teisingai
  30. //int a[] = { 1 , 2};
  31.  
  32. int suma = sum(a);
  33.  
  34.  
  35. cout << suma;
  36.  
  37. cin >> b;
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement