Assume there is a global variable & a static global
variable.Both gets memory allocated from the data segment.
Then how does the visiblity of static global varible gets
limited to the file alone (in which it gets declared) ???

Answers were Sorted based on User's Feedback



Assume there is a global variable & a static global variable.Both gets memory allocated from t..

Answer / usha hegde

A static global variable is having internal linkage. Once
the object file is created, this variable is not given to
the linker. Hence it is limited to the file alone.

Is This Answer Correct ?    49 Yes 1 No

Assume there is a global variable & a static global variable.Both gets memory allocated from t..

Answer / vinaykumarmp

Static variables are local in scope to their module in which
they are defined, but life is throughout the program. Say
for a static variable inside a function cannot be called
from outside the function (because it's not in scope) but is
alive and exists in memory. The next time this function is
entered (within the same program) the same chunk of memory
would be accessed now retaining the variables old value and
no new memory is allocated this time for this variable like
other variables in the function (automatic variables). So
basically the variable persists throughout the program.
Similarly if a static variable is defined in a global space
(say at beginning of file) then this variable will be
accessible only in this file (file scope).

Is This Answer Correct ?    11 Yes 21 No

Post New Answer

More Vxworks Interview Questions

Which RTOS supports Non-Preemptive scheduling ? Why other scheduling methods are supported by such Oses?

1 Answers   Elico,


what is task spawn in vxworks ?plz anyone explain me

2 Answers   NAL,


Assume there is a global variable & a static global variable.Both gets memory allocated from the data segment. Then how does the visiblity of static global varible gets limited to the file alone (in which it gets declared) ???

2 Answers   Wipro,


IN RTOS HAVING 1OKBYTES OF MEMORY AND YOUR PROGRAMM FOR ASKING FOR 5KBYTES AND YOU GOT NULL ERROR ? WHY DOES IT BEHAVES LIKE THIS

4 Answers  


what are the various methods to overcome it?

2 Answers   Vector India,






what do u mean by Semaphore..when v wil go for using this..explain about hat.what is the difference betw..binary ,,counting and mutex semphores

2 Answers   Bosch,


Write a code to connect Hardware interrupt to ISR...?

1 Answers   iNet, Wipro,


I have a situation where the programme counter(PC) shows that vxworks msgQreceive function has been called by task A and Q is full, still I am not picking up the messages. There is no other task registered to receive messages from this Q. The sending task B, which is ISR in this case, is getting timedout everytime it tries posting new message in it. A's state is PEND which means I am waiting for some resource to get free but PC shows I have called vxworks msgQReceive and currently at qJobget+0x018 location. There seems to be two causes now(identified by me): either vxworks qjobget task is not able to do semTake or no messages in Q. But Q is full and semTake failure seems unlikely(though I dont have a mechanism to check so). Besides explaining root cause for above, can anyone suggest how to get my task in READY state again? I also tried flushing the Q; on doing this, more messages get posted in Q but A still doesnt pick up any :(

4 Answers  


What is priority inversion?

10 Answers   Juniper Networks,


hi this is srikanth i need video classes for Vxworks any body having this forward me thanking u

1 Answers   DELL, Wipro,


What is another for creating a task without using taskspawn?

2 Answers  


Categories