473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Some Questions Asked in Interview

I 'm a professional looking for the job.In interview these questions
were asked with some others which I answered.But some of them left
unanswered.Plz help.

Here are some questions on C/C++, OS internals?
Q1 . What is the use of pointer to an array?
Q2 . What is the use of array of pointers?
Q3 . What is the use of pointer to function ?
Q4 . How to print through serial port? What is Flow Control(Xon,Xoff)
?
Q5 . What is IOCTL Explain .
Q6 . How to create an interrupt service routine in C?
Q7 . What are the internals of a schedular ?
Q8 . The static variables are declared in heap or stack ?
Nov 14 '05
50 4282
In <f7**************************@posting.google.com > iu*********@yahoo.co.in (anonymous) writes:
Static variables are declared in neither heap nor stack, they are declared
in C source code files. And they are *allocated* whereever the
implementor chooses to, typically neither in heap (the malloc and friends
arena) nor in stack (automatic allocation arena and function call related
data).
But is it not required to allocate static variables in heap, so
that their values are intact even after a function is called more than once?


Then, why the hell would you want to allocate them in a *dynamic* data
structure?
Then generally where are they allocated?.


In a static data structure, usually called the program's data segment.
Depending on how they are initialised, they can be allocated in its
initialised part (that is "mirrored" in the executable file) or in its
"uninitialised" part (that is zero filled by the OS) that occupies no
space in the executable file (only its size and relative address are
stored).

Things are slightly different in the case of freestanding implementations,
where, instead of executable file, the initialised data might be stored
in some kind of non-volatile, read-only memory, before being copied to the
actual read/write memory where it was actually allocated, as part of
the program startup procedure, before main() is actually executed.

Anyway, the program doesn't care where its static data is allocated,
and this is the only thing that matters in the context of this newsgroup.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #51

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Spammay Blockay | last post by:
I've been tasked with doing technical interviews at my company, and I have generally ask a range of OO, Java, and "good programming technique" concepts. However, one of my favorite exercises I...
27
by: Jatinder | last post by:
I 'm a professional looking for the job.In interview these questions were asked with some others which I answered.But some of them left unanswered.Plz help. Here are some questions on C/C++, OS...
18
by: free2cric | last post by:
Hi, I attanded an interview on C++ Question asked were and my answers to them.. 1. In a CPP program what does memory leak occure? -- i said.. In a constructor , the pointer variables were...
162
by: techievasant | last post by:
hello everyone, Iam vasant from India.. I have a test+interview on C /C++ in the coming month so plz help me by giving some resources of FAQS, interview questions, tracky questions, multiple...
26
by: pandapower | last post by:
Hi, These were some of the interview questions asked,can someone discuss whats the solution. 1.I have a singly linked list and i have to print the 5th element from the last.I have to print it...
18
by: Matt | last post by:
I had these questions in an interview today: 1. Define a class using C. 2. Write a C functions that does garbage collection: frees all allocated memories. 3. Define semaphore. 4. What is...
0
by: softwareengineer2006 | last post by:
10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for all companies between year 2000-2005...
0
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for...
4
by: Mr. X. | last post by:
Hello. I need some help, please. What can an employee ask (technical questions), if I am interviewed of Dot-net developer (also VB.NET and C#). (What are the most general questions, that I may...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.