Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- char* fnpro(int* vystup, int funkce1, int funkce2, int funkce3, int funkce4);
- int vystup;
- int funkce1;
- int funkce2;
- int funkce3;
- int funkce4;
- int z; //připraveno pro použití jako výstup z funkce fnpro
- char y[4000];
- int _tmain(int argc)
- {
- fnpro(&z, 10, 20, 30, 40);
- sprintf(y,"%s",fnpro(&z, 10, 20, 30, 40));
- cout << " text je: ";
- cout << y;
- cout << "\n";
- cout << " cislo je: ";
- cout << z;
- cout << "\n";
- system("pause");
- }
- char* fnpro(int* vystup, int funkce1, int funkce2, int funkce3, int funkce4)
- {
- char r1eturn[200]; //vracená textová hodnota
- //z = vystup;
- *vystup = (funkce1 + funkce2 + funkce3 + funkce4) * funkce3;
- sprintf(r1eturn, "%d=(%d+%d+%d+%d+%d)*%d", *vystup, funkce1, funkce2, funkce3, funkce4, funkce3);
- return r1eturn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement