Playground
#include <iostream> using namespace std; struct newType { int x, y; }; int func(newType *p) { //val = (*p).x + (*p).y int val = p->x + p->y; return val; } int main() { newType p; p.x = 3; p.y = 7; //argument na funkcijata func e pokazhuvach, pa //potrebno e da ja ispratime adresata na (p) int res = func(&p); cout << res << endl; //pechati '10' return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!