I want to make a function to pass and return values from the same arguments. For example prm3=0 after function's execution must become prm3=3, and next prm3=6, and next prm3=9 ...
I wrote the following but it doesn't work. p1,p2,p3 are not passed to prm1, prm2, prm3. What is wrong? Any example returning more than one values?
#include <stdio.h>
void increments (int prm1, int prm2, int prm3);
int prm1=0, prm2=0, prm3=0;
int main(void)
{
while (1){
increments (prm1, prm2, prm3);
}
return (0);
}
void increments (int p1, int p2, int p3){
p1 += 1;
p2 += 2;
p3 += 3;
}