Newby: help needed

I have an Arduino UNO and on top of that a 3G shield. Just playing around I managed to post some data to an internet site.
Now I'd like to give a better structure to my program. So I've decided to split the source code into 2 files: 1st containing the setup and loop functions; 2nd containing the sendAT functions used to send the commands.
In the sendAT functions I use an aux_str array variable to build the command to send to the 3g shield. What I'm experiencing is that if I declare the aux_str array (i.e. char *aux_str[32]; ) in the 1st file (that contaning the loop and setup functions), all is working perfect. If I move the declaration to the second file where I use the variable, the 3g shield seems not to get any command more: debugging the application with the serial moniotor, I see that the send command I build in the aux_str is correct (just the same as in the working example), but there's no reaction from the shield.
Any idea about the difference between the 2 project arrangements?
Thank you in advance

Any idea about the difference between the 2 project arrangements?

One works. One doesn't. Without seeing the code, I'm not going to try to explain why.

in simple terms without looking at your code.

if you are declaring the variable within a function or subroutine, it only remembers the values while it in that routine/function the one time.
if you declare them before your setup, the values are global and can be used in any subroutine or function and when you update the value the updated value will be remembered.

just remember that you only declare it once if you are going that route.

int savedvalue = 1;
then when you want to change it
saved value=2;
not
int savedvalue = 2;

Thanks for your help. To clarify my program structure (in the meanwhile I splitted it into 3 files):

  1. starting point was the code contributed by Mr Jean Britz on Github:
    arduino-test-scripts/SIM5216_http_post.ino at master · jeanbritz/arduino-test-scripts · GitHub
    That's working pretty good.
  2. I've created 2 new files in the arduino IDE: sendAT.ino and process.ino. In the "sendAT.ino" I've moved all Britz's functions, but loop() and setup() which I leaved in the initial file; in the "process.ino" I've created a new function "sendDataProcess" where I moved all the content of Mr Britz's loop() function, while adding a call to the "sendDataProcess" in my new loop function.
    Now: if I leave the char aux_str [32] declaration (Mr Britz's line 29) in the file with the loop() and setup() functions the program still works; if I move the same declaration in the "process.ino", the program doesn't work any more, even if it doesn't stop or reset (I can see that Mr Britz's sendATcommand(aux_str, AT_CHTTPACT_INIT_RESPONSE, 60000) times out).

Other question: is there no need for header files in Arduino, neither for extern declarations? I.e. for my sendAT.ino and process.ino files I don't need to create header files to expose functions protoype to the other files or extern declarations to refer to variables from other files in the project, do I?

Thank you in advance, regards

I went one step further after reading the .cpp file that Arduino IDE puts together starting from my .ino files: the difference between Mr Britz's arrangement (see my previous post pointing to Mr Britz's solution) and mine is that in Mr Britz's case the char aux_str [32] declaration is at the beginning of that .cpp file, whereas in my case is just berfore the functions that are using it.
Why is the behaviors so different? Is it so important the place where I declare a variable, provided that it is declared before I use it?

Is it so important the place where I declare a variable, provided that it is declared before I use it?

It is if you want it to be global rather than local to the function or code block that it is declared in.

It is if you want it to be global rather than local to the function or code block that it is declared in.

That's the minimum a programmer must know. What I meant is: provided that you declare a variable outside any function because you want it to be global, is it so important to declare a variable at the very beginning of a sketch, rather than between two functions further down in your code? The question arises because as I said reading through the .cpp file that ArduinoIDE builds, the only difference between what is working and what is not is that the array declaration is at the very beginning (working) rather than between two functions, but before its usage (not working).