main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i>2)
goto here;
i++;
}
}
fun()
{
here:
printf("PP");
}
Answers were Sorted based on User's Feedback
Answer / surenda pal singh chouhan
Compiler error: Undefined label 'here' in function main
Explanation:
Labels have functions scope, in other words The scope of
the labels is limited to functions . The label 'here' is
available in function fun() Hence it is not visible in
function main.
Is This Answer Correct ? | 16 Yes | 0 No |
Answer / jaroosh
Exactly, to be able to move control flow to here, you would
have to make a long jump using not very common functions
(that do actually more than goto) : setjmp and longjmp
(please look up those functions in google or some C standard
library reference).
Is This Answer Correct ? | 5 Yes | 1 No |
The program is error because of the "goto" statement can't
jump from one segment to another segment i.e not support for
long jump.
Is This Answer Correct ? | 3 Yes | 0 No |
Define and explain about ! Operator?
Explain the term printf() and scanf() used in c language?
How to write c functions that modify head pointer of a linked list?
Why is it that not all header files are declared in every C program?
what is the difference between c and java?
write a C program to print the program itself ?!
What is the purpose of sprintf() function?
what does exit() do?
how do you execute a c program in unix.
Difference between C and Embedded C?
program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
Does free set pointer to null?