All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Bambach <eric@cisu.net>
To: Arturas Moskvinas <arturas.moskvinas@gmail.com>
Cc: linux prg <linux-c-programming@vger.kernel.org>
Subject: Re: Printf and scanf
Date: Sun, 5 Jun 2005 09:03:06 -0500	[thread overview]
Message-ID: <200506050903.06198.eric@cisu.net> (raw)
In-Reply-To: <4a618d0805060506545a4337be@mail.gmail.com>

On Sunday 05 June 2005 08:54 am, Arturas Moskvinas wrote:
> > hi
> >
> > this is a simple problem which somebody asked me and i
> > am not able to solve. if somebody here can help me out
> >
> > i just want to know how scanf function can be used on
> > the place of printf and vice versa
>
> Scanf reads from STDIN and printf writes into STDOUT. I do not think
> there is any way to change reading operation with writing... Of course
> some alchemy might help you :)
>
> I think you misinterpreted something...

I agree. At a most basic level printf copies its arguments into STDOUTs 
buffer. Scanf reads from STDINs buffer and copies to its arguments memory 
space. There is no way to make these functions behave differently. Perhaps 
with fprintf and fscanf you can make some magic...but its a silly exercise 
and would make code unholy and unreadable.
> Arturas Moskvinas
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs

-- 
----------------------------------------
--EB

> All is fine except that I can reliably "oops" it simply by trying to read
> from /proc/apm (e.g. cat /proc/apm).
> oops output and ksymoops-2.3.4 output is attached.
> Is there anything else I can contribute?

The latitude and longtitude of the bios writers current position, and
a ballistic missile.

                --Alan Cox LKML-December 08,2000 

----------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2005-06-05 14:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-05 12:21 Printf and scanf Ankit Jain
2005-06-05 13:54 ` Arturas Moskvinas
2005-06-05 14:03   ` Eric Bambach [this message]
2005-06-05 13:59 ` Steve Graegert
2005-06-24 21:20 ` Hendrik Visage
2005-06-27 18:11   ` Andriot
2005-06-28  3:42     ` joy merwin monteiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200506050903.06198.eric@cisu.net \
    --to=eric@cisu.net \
    --cc=arturas.moskvinas@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.