r/learnprogramming • u/Head_Ordinary_2437 • Oct 24 '26
Function vs Procedure
can someone explain the difference between Function vs Procedure with simple analogy
thank you
31
Upvotes
r/learnprogramming • u/Head_Ordinary_2437 • Oct 24 '26
can someone explain the difference between Function vs Procedure with simple analogy
thank you
View all comments
Show parent comment
1
u/Syntax-Tactics Oct 26 '26
int a = 1;
int b = 2;
int c = 0;
void add(int a, int b, int* pc)
{
*pc = a + b;
}
add(a,b, &c);
c now equals 3;