Re: How it works?
- From: Barry Schwarz <schwarzb@xxxxxxxxx>
- Date: Sun, 30 Apr 2006 10:13:43 -0700
On 29 Apr 2006 16:36:10 -0700, "Mohan" <mohan.smvec@xxxxxxxxx> wrote:
Hi Friends,stdout is a FILE* that is declared in stdio.h and defined and
The following code is working fine and printing the string "Mohan S".
#include<stdio.h>
int main()
{
FILE *fp;
fp=stdout;
fprintf(fp,"%s","Mohan S");
}
My doubt is how it is possible to assign a standard output stream to a
file stream....Why it didn't throw any error;instead its running
fine...
Can anyone give me clear explanations... ?
Thanks in advance...
initialized by the startup code that executes prior to main. fp is a
FILE* defined in your program. It is perfectly legal for two pointers
to point to the same object.
Remove del for email
.
- References:
- How it works?
- From: Mohan
- How it works?
- Prev by Date: Re: String Pattern Matching algo
- Next by Date: Re: Question about (double *)NULL
- Previous by thread: Re: How it works?
- Next by thread: Question about "enums"
- Index(es):
Relevant Pages
|