void update(char array[10]) {
// function implementation
}
int main(int argc, char **argv) {
char array[10] = "welcome";
update(array);
return 0;
}
I am trying to pass a pointer-to-array to another function without losing its array metadata. In other words, when I am debugging and control jumps inside "update" function, I no longer can inspect the state of each of my 10 characters as they get modified by the "update" function because control is no longer within the scope where the array was created. Once control jumps out of the "update" function and returns to the "main" or calling function, only then I can see the updated version of the referenced array.
Is there a way to fix this?
As a side note, I am using the built-in debugger that comes with Visual Studio Code as well as the GCC compiler.