View All num of num See all Photos Texas Instruments This employer has taken extra steps to respond to reviews and provide job seekers with accurate company information, photos, and reviews. Interested for your company?Learn More. www.ti.com www.ti.com Work in HR? Unlock Free Profile Overview Reviews Salaries Interviews Jobs Photos Benefits 1.2k Reviews 3.4k Salaries 455 Interviews 272 Jobs Follow Add Review or Salary Follow Add Review or Salary Texas Instruments 1223 Interview Question Software Engineer Interview(Student Candidate) Tiruchchirāppalli (India) Texas Instruments Driver question and Questions related to how C program is stored in memory and why cant we access local variables from other blocks(relating to how they are stored in memory) Tags: See more , See less 8 Answer Add Tags Flag as Inappropriate Thank you! Your feedback has been sent to the team and we'll look into it. Oops! We're sorry but your feedback didn't make it to the team. Your input is valuable to us — would you mind trying again? Send Answer Interview Answer 1 Answer ▲ 0 ▼ In C, you have 3 "types" of memory: the stack, the heap and the data segment. All the variables declared and used in a c function are allocated on the stack. The most important thing about the stack is that, it is "freed" after execution of the function, i.e. the variables are no longer stored on the stack.malloc, calloc and realloc calls allow memory allocation on the heap. These memory segments must be managed manually by the programmer, i.e. the programmer is responsible to free the heap. So it is critical to always have a pointer pointed to the allocated segment, in order to free it later. Variables on the heap can be accessed from outside the functions they are declared in. A "memory leak" occurs, when a variable allocated on the heap does not get freed when the execution of the whole code is done.All global variables, static variables and function return values are stored in the data segment.This is how I would answer such a question. These are very basic stuff, that every firmware developer must know! Hachem on Nov 19, 2013 Flag as Inappropriate Thank you! Your feedback has been sent to the team and we'll look into it. Oops! We're sorry but your feedback didn't make it to the team. Your input is valuable to us — would you mind trying again? Send Add Answers or Comments To comment on this, Sign In or Sign Up.