1)can any one give an example for a C program that can be written
using goto only ? i.e a program in which we cannot avoid the keyword
goto
It depends on what you mean by "a C program."
In a formal sense, it's easy to see that goto can always
be eliminated. (Somebody or other proved this in a paper
that always gets cited, but it always seemed to me that they
had proved the sky was blue. But then, I haven't read the
paper.)
However, the source code changes to eliminate goto might
make a particular program larger than it had been, and it
might become too big for the compiler to compile or for the
host computer to execute. So it is at least conceivable that
there exists at least one (very large) program which would
cease to function if the goto's were eliminated. Constructing
such a program would probably require a very large effort.
2)what exactly is the purpose of tmpfile() ? will it open a temporary
file ?
It creates and opens a temporary file. "Temporary"
means that the file will be deleted from the permanent file
storage when the program ends, even if the program doesn't
call remove() on it. It can be useful when a program must
process large amounts of data in multiple "passes," where
one pass writes to the temporary file and others read it
back in again.
3)why there is no article on dangling pointer in the FAQ ?
Maybe the questions about dangling pointers aren't FA.