Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <kst-u@mib.org> |
| Newsgroups | comp.lang.c |
| Subject | Re: Why this behavior? |
| Date | Sat, 28 Mar 2015 17:34:56 -0700 |
| Organization | None to speak of |
| Lines | 27 |
| 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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="c77ff4d35e33d1c939d3461ebde8dd0d"; logging-data="32232"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+dmU5sV+u+eLrW8fxthqf" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
| Cancel-Lock | sha1:yUMYsBvgnRffh9ce7YZ/8InUA2M= sha1:5oRcQ05wsiUemQv79bp/YCGdk20= |
| Xref | csiph.com comp.lang.c:59183 |
Show key headers only | View raw
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