freelanceprogrammers.org Forum Index » C

Doubt on STDOUT


View user's profile Post To page top
kanna_linux@... Posted: Mon Aug 25, 2003 9:51 am


Joined: 25 Aug 2003

Posts: 3
Doubt on STDOUT
Hello everyone,
 
I am sathis working as s/w engineer.I have given my doubt below
 
When we use "stdout" in the printf statement,where data will be written.
 
Will it be in particular address location?? What interrupt will be generated??
 
-Kanna
Win TVs, Bikes, DVD players and more!
Click on
Yahoo! India Promos
Reply with quote
Send private message
View user's profile Post To page top
kcool127 Posted: Mon Aug 25, 2003 6:35 pm


Joined: 25 Aug 2003

Posts: 2
Doubt on STDOUT
hi kanna,
well, "stdout" stands for standard output. so when u
sue it, it selects the standard output device for the
place to format the text to basically the monito.
similarly, " stdin" stands for standard input which is
basically the keyboard. so u can use the printf
statement like u would use it for a file, but instead
of specifyin a file, specify stdout. works the same as
a normal printf statement.
i`ll send u the example in another mail. and more
doubts, get in touch!!
--- ad asd <kanna_linux@...> wrote:
> Hello everyone,
>
> I am sathis working as s/w engineer.I have given my
> doubt below
>
> When we use "stdout" in the printf statement,where
> data will be written.
>
> Will it be in particular address location?? What
> interrupt will be generated??
>
> -Kanna
>
> Win TVs, Bikes, DVD players and more!Click onYahoo!
> India Promos


=====
Keep Rocking & stay cool!!!!

Kcool

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
kanna_linux@... Posted: Tue Aug 26, 2003 2:00 pm


Joined: 25 Aug 2003

Posts: 3
Doubt on STDOUT
HI karan,

Thanks for the reply.Basically stdou/stdin are buffer
which holds from/to device.

But i want to know the flow how stdout is printed on
device.

For example,consider the following prg.

main()
{
printf("The time is");
System(time);
}
here time prints first & printf statments are printed
afterwards.

I want to know the reason why it is happening??

But printf("The time is
"): displays correctly.

Regards,
kanna


--- Karan Rath <kcool127@...> wrote: > hi
kanna,
> well, "stdout" stands for standard output. so when u
> sue it, it selects the standard output device for
> the
> place to format the text to basically the monito.
> similarly, " stdin" stands for standard input which
> is
> basically the keyboard. so u can use the printf
> statement like u would use it for a file, but
> instead
> of specifyin a file, specify stdout. works the same
> as
> a normal printf statement.
> i`ll send u the example in another mail. and more
> doubts, get in touch!!
> --- ad asd <kanna_linux@...> wrote:
> > Hello everyone,
> >
> > I am sathis working as s/w engineer.I have given
> my
> > doubt below
> >
> > When we use "stdout" in the printf statement,where
> > data will be written.
> >
> > Will it be in particular address location?? What
> > interrupt will be generated??
> >
> > -Kanna
> >
> > Win TVs, Bikes, DVD players and more!Click
> onYahoo!
> > India Promos
>
>
> =====
> Keep Rocking & stay cool!!!!
>
> Kcool
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
>
>
> ------------------------ Yahoo! Groups Sponsor
>
> Keep posting
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

________________________________________________________________________
Yahoo! India Promos: Win TVs, Bikes, DVD players & more!
Go to http://in.promos.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
sandya_k_in Posted: Tue Aug 26, 2003 11:00 pm


Joined: 26 Aug 2003

Posts: 1
Doubt on STDOUT
The problem is not due to interrupts but the was the C library is
implemented. When you use printf(), the output is buffered till
either
a)some number of characters accumulate OR
b) u print a `/n`
c) u do fflush(stdout)

- Also,the stdout is flushed when a process exits
- When you call system(time), a new process is forked which executes
the `time` command. The time gets printed when this process exits.
The control then returns to your prog...and when it exits it prints
"The time is: "

HTH,
Sandhya

--- In Programmers-Town@yahoogroups.com, ad asd <kanna_linux@y...> wrote:
> HI karan,
>
> Thanks for the reply.Basically stdou/stdin are buffer
> which holds from/to device.
>
> But i want to know the flow how stdout is printed on
> device.
>
> For example,consider the following prg.
>
> main()
> {
> printf("The time is");
> System(time);
> }
> here time prints first & printf statments are printed
> afterwards.
>
> I want to know the reason why it is happening??
>
> But printf("The time is
"): displays correctly.
>
> Regards,
> kanna
>
>
> --- Karan Rath <kcool127@y...> wrote: > hi
> kanna,
> > well, "stdout" stands for standard output. so when u
> > sue it, it selects the standard output device for
> > the
> > place to format the text to basically the monito.
> > similarly, " stdin" stands for standard input which
> > is
> > basically the keyboard. so u can use the printf
> > statement like u would use it for a file, but
> > instead
> > of specifyin a file, specify stdout. works the same
> > as
> > a normal printf statement.
> > i`ll send u the example in another mail. and more
> > doubts, get in touch!!
> > --- ad asd <kanna_linux@y...> wrote:
> > > Hello everyone,
> > >
> > > I am sathis working as s/w engineer.I have given
> > my
> > > doubt below
> > >
> > > When we use "stdout" in the printf statement,where
> > > data will be written.
> > >
> > > Will it be in particular address location?? What
> > > interrupt will be generated??
> > >
> > > -Kanna
> > >
> > > Win TVs, Bikes, DVD players and more!Click
> > onYahoo!
> > > India Promos
> >
> >
> > =====
> > Keep Rocking & stay cool!!!!
> >
> > Kcool
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> > design software
> > http://sitebuilder.yahoo.com
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> >
> > Keep posting
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
>
> ________________________________________________________________________
> Yahoo! India Promos: Win TVs, Bikes, DVD players & more!
> Go to http://in.promos.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
shantanu_k06 Posted: Tue Aug 26, 2003 11:44 pm


Joined: 19 Jul 2003

Posts: 29
Doubt on STDOUT
Hi friends,

For last several months I have been trying to get this
book titled "Advanced CORBA Programming with C++" by
Michi Henning and Steve Vinoski, Addison Wesley
publishing (6th reprint, year 2002). However, despite
my best efforts I am not able to get the same.

Meanwhile, I got a clue from somebody saying it might
be available with "Technical Book Store" at Pune which
happens to be the same bookstore where he got his copy
from. If you happen to be from Pune and know where
this bookstore is, could you please let me know the
address or telephone number of this store? In case you
know some other source (at any city) where this title
is available, you may please tell me that too. I would
be very thankful for your help.

Regards,
Shantanu


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
kcool127 Posted: Wed Aug 27, 2003 9:16 am


Joined: 25 Aug 2003

Posts: 2
Doubt on STDOUT
yeah!! that`s exactly how its done. hope that answers
ur doubt kanna. btw, how do u guys use technical
jargon so cooly?? i know how it works but had a prob
explainin the concept. nice work sandya!!
--- sandya_k_in <sandya_k_in@...> wrote:
> The problem is not due to interrupts but the was the
> C library is
> implemented. When you use printf(), the output is
> buffered till
> either
> a)some number of characters accumulate OR
> b) u print a `/n`
> c) u do fflush(stdout)
>
> - Also,the stdout is flushed when a process exits
> - When you call system(time), a new process is
> forked which executes
> the `time` command. The time gets printed when this
> process exits.
> The control then returns to your prog...and when it
> exits it prints
> "The time is: "
>
> HTH,
> Sandhya
>
> --- In Programmers-Town@yahoogroups.com, ad asd
> <kanna_linux@y...> wrote:
> > HI karan,
> >
> > Thanks for the reply.Basically stdou/stdin are
> buffer
> > which holds from/to device.
> >
> > But i want to know the flow how stdout is printed
> on
> > device.
> >
> > For example,consider the following prg.
> >
> > main()
> > {
> > printf("The time is");
> > System(time);
> > }
> > here time prints first & printf statments are
> printed
> > afterwards.
> >
> > I want to know the reason why it is happening??
> >
> > But printf("The time is
"): displays correctly.
> >
> > Regards,
> > kanna
> >
> >
> > --- Karan Rath <kcool127@y...> wrote: > hi
> > kanna,
> > > well, "stdout" stands for standard output. so
> when u
> > > sue it, it selects the standard output device
> for
> > > the
> > > place to format the text to basically the
> monito.
> > > similarly, " stdin" stands for standard input
> which
> > > is
> > > basically the keyboard. so u can use the printf
> > > statement like u would use it for a file, but
> > > instead
> > > of specifyin a file, specify stdout. works the
> same
> > > as
> > > a normal printf statement.
> > > i`ll send u the example in another mail. and
> more
> > > doubts, get in touch!!
> > > --- ad asd <kanna_linux@y...> wrote:
> > > > Hello everyone,
> > > >
> > > > I am sathis working as s/w engineer.I have
> given
> > > my
> > > > doubt below
> > > >
> > > > When we use "stdout" in the printf
> statement,where
> > > > data will be written.
> > > >
> > > > Will it be in particular address location??
> What
> > > > interrupt will be generated??
> > > >
> > > > -Kanna
> > > >
> > > > Win TVs, Bikes, DVD players and more!Click
> > > onYahoo!
> > > > India Promos
> > >
> > >
> > > =====
> > > Keep Rocking & stay cool!!!!
> > >
> > > Kcool
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! SiteBuilder - Free, easy-to-use web site
> > > design software
> > > http://sitebuilder.yahoo.com
> > >
> > >
> > > ------------------------ Yahoo! Groups Sponsor
> > >
> > > Keep posting
> > >
> > > Your use of Yahoo! Groups is subject to
> > > http://docs.yahoo.com/info/terms/
> > >
> > >
> >
> >
>
________________________________________________________________________
> > Yahoo! India Promos: Win TVs, Bikes, DVD players &
> more!
> > Go to http://in.promos.yahoo.com
>
>
>


=====
Keep Rocking & stay cool!!!!

Kcool

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
karibasava_007 Posted: Wed Aug 27, 2003 9:42 am


Joined: 27 Aug 2003

Posts: 1
Doubt on STDOUT
This is without using any other variable.

1] main()
{
int i=20,j=10;
i=i+j;
j=i-j;
i=i-j;
}


2] main()
{
int i=20,j=10;
i=i*j;
j=i/j;
i=i/j;

}


This is by using temporary variable.

3]

main()
{
int i=20,j=10,temp;
temp=i;
i=j;
j=temp;
}


This is by passing address

4] main()
{
int a=20,b=10;
swap(&a,&b);

}

swap( int *a,int *b)
{
int t;
t=*a;
*a=*b;
*b=t
}


This is by passing value

5] main()
{
int i=20,j=10;
swap(i,j);

}

swap(int &a,int &b)
{

int t;
t=a;
a=b;
b=t;
}





6] main()
{
int i=20,j=30;
i=i exor j;
j=j exor i;
i=i exor j;

}


u can also swap by using shift operators but i am not
getting efficient method.




















________________________________________________________________________
Yahoo! India Promos: Win TVs, Bikes, DVD players & more!
Go to http://in.promos.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
kanna_linux@... Posted: Wed Aug 27, 2003 2:00 pm


Joined: 25 Aug 2003

Posts: 3
Doubt on STDOUT
Thanks sandya & karan.I got it..
 
-KannaKaran Rath <kcool127@...> wrote:

yeah!! that`s exactly how its done. hope that answersur doubt kanna. btw, how do u guys use technicaljargon so cooly?? i know how it works but had a probexplainin the concept. nice work sandya!!--- sandya_k_in wrote:> The problem is not due to interrupts but the was the> C library is> implemented. When you use printf(), the output is> buffered till > either> a)some number of characters accumulate OR> b) u print a `/n` > c) u do fflush(stdout)> > - Also,the stdout is flushed when a process exits> - When you call system(time), a new process is> forked which executes> the `time` command. The time gets printed when this> process exits.> The control then returns to your prog...and when it> exits it prints> "The time is: ">
> HTH,> Sandhya> > --- In Programmers-Town@yahoogroups.com, ad asd> wrote:> > HI karan,> > > > Thanks for the reply.Basically stdou/stdin are> buffer> > which holds from/to device.> > > > But i want to know the flow how stdout is printed> on> > device.> > > > For example,consider the following prg.> > > > main()> > {> > printf("The time is");> > System(time);> > }> > here time prints first & printf statments are> printed> > afterwards.> > > > I want to know the reason why it is happening??> > > > But printf("The time is
"): displays correctly.> > > > Regards,> > kanna> > > > > > --- Karan Rath wrote: > hi> >
kanna,> > > well, "stdout" stands for standard output. so> when u> > > sue it, it selects the standard output device> for> > > the> > > place to format the text to basically the> monito.> > > similarly, " stdin" stands for standard input> which> > > is> > > basically the keyboard. so u can use the printf> > > statement like u would use it for a file, but> > > instead> > > of specifyin a file, specify stdout. works the> same> > > as> > > a normal printf statement.> > > i`ll send u the example in another mail. and> more> > > doubts, get in touch!!> > > --- ad asd wrote:> > > > Hello everyone,> > > > > > > > I am sathis working as s/w engineer.I have> given> > >
my> > > > doubt below> > > > > > > > When we use "stdout" in the printf> statement,where> > > > data will be written.> > > > > > > > Will it be in particular address location??> What> > > > interrupt will be generated??> > > > > > > > -Kanna> > > > > > > > Win TVs, Bikes, DVD players and more!Click> > > onYahoo!> > > > India Promos> > > > > > > > > =====> > > Keep Rocking & stay cool!!!!> > > > > > Kcool> > > > > > __________________________________> > > Do you Yahoo!?> > > Yahoo! SiteBuilder - Free, easy-to-use web site> > > design software> > > http://sitebuilder.yahoo.com> > > > > >
> > > ------------------------ Yahoo! Groups Sponsor> > > > > > Keep posting > > > > > > Your use of Yahoo! Groups is subject to> > > http://docs.yahoo.com/info/terms/ > > > > > > > > > >>________________________________________________________________________> > Yahoo! India Promos: Win TVs, Bikes, DVD players &> more!> > Go to http://in.promos.yahoo.com> > > =====Keep Rocking & stay cool!!!!Kcool__________________________________Do you Yahoo!?Yahoo! SiteBuilder - Free, easy-to-use web site design softwarehttp://sitebuilder.yahoo.com------------------------ Yahoo! Groups Sponsor ---------------------~-->Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or LexmarkPrinter at Myinks.com. Free s/h on orders $50 or more to
the US & Canada. http://www.c1tracking.com/l.asp?cid=5511http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/EbFolB/TM---------------------------------------------------------------------~->Keep posting Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Win TVs, Bikes, DVD players and more!
Click on
Yahoo! India Promos
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help