What is the real time usage volatile?
Answers were Sorted based on User's Feedback
Answer / stylish_312
volatile int i=10;
main()
{
fun()
{
while(i==10)
{
...
}
printf("This will print..\n");
}
}
ANS:
if we are not using volatile int ,the loop will be keep on
exeecuting,so printf statement will not print...to break
this loop declare the variable as a volatile....
| Is This Answer Correct ? | 8 Yes | 2 No |
What is the scope of an external variable in c?
What is Lazy evaluation in C? Give an example.
Can the sizeof operator be used to tell the size of an array passed to a function?
What is d scanf?
increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {
where can function pointers be used?
how to print 212 as Twohundreds twelve plz provide me ans soon
what is the advantage of function pointer
16 Answers CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,
Explain the difference between malloc() and calloc() in c?
How we add our function in liabrary as liabrary function. Exp. we want use our int factorical(int); function as int pow(int,int); function working in math header file.
Write a simple code fragment that will check if a number is positive or negative.
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].