Simple question


#1

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?


#2

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


#3

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


#4

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.