C/C

Advertisement


Question
i was asked in interview that " we wrote a c program using  function and also assign memory from heap(used malloc),how it ll oprerated in stack, how it is really working. means in stack 1st return adders of main, fi fun called a stack frame is created... like how it is executing step by step.


Answer
This cannot be a generic question.
This must be specific to operating system.
Each OS will have its own way of doing things.
And this is done based on the underlying hardware.
So, Sun Solaris on Sparc based systems and the same version of Sun Solaris on x86 based system will have different strategy.
You can only know one or two operating system in detail.

So, you must ask the interviewer, which OS you are talking about?
And if you don't know that particular OS, you can tell that I don't know that OS. And if you have knowledge in some other OS, you can offer to tell about that OS.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.