Nazdar, učím sa narábať s ukazovatelmi. Vytvoril som si jednoduchú funkciu na sčítanie 2 čísiel. (Viď nižšie) No a teraz by som v tej funkcii chcel použiť ukazovatele, profka to chcela na hodine ale nevedel som to. Je tu niekto kto program prerobí aby tam boli použité ukazovatele?
Kód:
#include<stdio.h>
int scitaj(int x,int y);
int main()
{
int a,b;
printf("Zadaj a: ");
scanf("%d",&a);
printf("Zadaj b: ");
scanf("%d",&b);
printf("Sucet je %d",scitaj(a,b));
getch();
return 0;
}
int scitaj(int x,int y)
{
return(x+y);
}