Simple question

Please help with simple question:

u16 increment(u16 value){
   u16 result = value + 1;
   return result;

u16 value1 = 0;
u16 value2 = increment(value1);

value2 is always = 0, what is wrong?

How do you determine that value2 is always = 0 :question:

sprintf(msg, “Returned: %d”, value2);
print msg…

You need to show the code that you’re actually using.

Post the smallest complete, compilable example that exhibits the problem.

Use copy-and-paste - do not manually re-type the code into your post.