Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Why this behavior? |
| Date | 2015-03-28 17:34 -0700 |
| Organization | None to speak of |
| Message-ID | <877fu0myj3.fsf@kst-u.example.com> (permalink) |
| References | <mf620e$sh7$1@dont-email.me> <fc015833-c906-498e-8553-3d0a741a16c0@googlegroups.com> <mf6hvl$hek$1@dont-email.me> |
bilsch <king621@comcast.net> writes:
>> However there's a freopen() command that you can use to redirect stdin
>> stdout and stderr. So commonly when programs are being debugged, and the
>> developer wants to scatter printf() and scanfs(), the streams are
>> attached to an interactive prompt, which often pops up in its own
>> window.
>> If you do a web search on your operating system and "redirecting stdout
>> / stdin" you'll find out how to do this.
>
> I searched as you suggested and read a lot I don't understand - and
> nothing specific to anything I do understand. Apparently I need to use
> this freopen() command in my program and somehow get an interactive
> window to pop up that will show the text output by the printf() commands
> and accept input to the scanf() commands which are in my program. The
> program needs to get Ubuntu to provide this interactive window or does
> the code have to create the interactive window?
If you're on Ubuntu, just run the program from a shell prompt. Its
stdin, stdout, and stderr will be inherited from the shell: stdin will
read from the keyboard, and stdout and stderr will write to the terminal
(emulator).
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Why this behavior? bilsch <king621@comcast.net> - 2015-03-28 11:06 +0000
Re: Why this behavior? Richard Heathfield <rjh@cpax.org.uk> - 2015-03-28 11:16 +0000
Re: Why this behavior? bilsch <king621@comcast.net> - 2015-03-28 11:22 +0000
Re: Why this behavior? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-03-28 15:22 +0000
Re: Why this behavior? Richard Heathfield <rjh@cpax.org.uk> - 2015-03-28 21:42 +0000
Re: Why this behavior? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-03-28 05:53 -0700
Re: Why this behavior? bilsch <king621@comcast.net> - 2015-03-28 15:39 +0000
Re: Why this behavior? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-03-28 09:24 -0700
Re: Why this behavior? bilsch <king621@comcast.net> - 2015-03-28 17:05 +0000
Re: Why this behavior? bilsch <king621@comcast.net> - 2015-03-28 17:08 +0000
Re: Why this behavior? Keith Thompson <kst-u@mib.org> - 2015-03-28 17:34 -0700
Re: Why this behavior? Lőrinczy Zsigmond <nospam@for.me> - 2015-03-28 14:35 +0100
csiph-web