Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1.  
  2. #include "stdafx.h"
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. char* fnpro(int* vystup, int funkce1, int funkce2, int funkce3, int funkce4);
  7. int vystup;
  8. int funkce1;
  9. int funkce2;
  10. int funkce3;
  11. int funkce4;
  12. int z; //připraveno pro použití jako výstup z funkce fnpro
  13. char y[4000];
  14.  
  15. int _tmain(int argc)
  16. {
  17.  
  18. fnpro(&z, 10, 20, 30, 40);
  19. sprintf(y,"%s",fnpro(&z, 10, 20, 30, 40));
  20. cout << " text je: ";
  21. cout << y;
  22. cout << "\n";
  23. cout << " cislo je: ";
  24. cout << z;
  25. cout << "\n";
  26.  
  27.  
  28.  
  29.  
  30. system("pause");
  31. }
  32.  
  33. char* fnpro(int* vystup, int funkce1, int funkce2, int funkce3, int funkce4)
  34. {
  35. char r1eturn[200]; //vracená textová hodnota
  36. //z = vystup;
  37. *vystup = (funkce1 + funkce2 + funkce3 + funkce4) * funkce3;
  38. sprintf(r1eturn, "%d=(%d+%d+%d+%d+%d)*%d", *vystup, funkce1, funkce2, funkce3, funkce4, funkce3);
  39. return r1eturn;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement