Memory allocation in C

Status
Not open for further replies.

Mohan Giri

In Runtime
Messages
144
Hai everyone,
when we use more functions in our program how memory will be allocated for the function variables? I mean compiler will sequentially allocate the memory for all the function's variable? If we move one function to another, what happen to the previous function variables? Is it completely washedout from memory or hide in the memory???

I want to know these things for access one function variable from another without passing any arguments or pointers to the other function. Is it possible???

I tried to access but I can't. Atlast I used the following code to access. It did. But its not effective. If we use any variables in target function the source function variables are over written. Even if we use any statements like printf in target function we can't access the source function variable. Is there any other way???
 

Attachments

  • scope.txt
    449 bytes · Views: 24
Status
Not open for further replies.
Back
Top Bottom