Thanks, but I feel my question was not clear enough: If I call a void function that change an array declared elsewhere with a pointer, the array resets when the function ends. If I call that same function, but declare it an int or byte or whatever and I let it return a useless variable, the array is correctly modified. Why does that happens? A void function can't change a value that lasts after it ends?
- There is no void function, nor int function, nor anything like that. There are functions that return data, and one must declare what type that data is, and there are functions that don't return anything, and one tells that to the compiler by using the special type void.
- The data type returned by a function, be it void or anything else, has no influence whatsoever on what happens to the variables used inside that function. That depends only on the function code. What you are observing is definitely _not_ a direct effect of what type of data that function returns.
- "Post the code" in this context means two things:
1) copy-n-paste into a reply the _entire_ code where you use the "void function"
2) copy-n-paste into a reply the _entire_ code where you use the "int function"
Highlight the differences between the two codes and how they differ in their behaviour.
IMHO this is the only way you can get some help.