www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/13/18:47:20

Message-ID: <385573FD.88C57AF@ufu.br>
Date: Mon, 13 Dec 1999 19:32:31 -0300
From: bcc14 AT ufu DOT br (Bacharelado Curso Ciencia Computacao-14)
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Input?
References: <3855596D DOT 15459DEE AT pepparkakor DOT demon DOT nl>
Reply-To: djgpp AT delorie DOT com

--------------B9EE104BCE361AA0208E71CE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

There are several ways in which you can store a value in a variable, but for
the ANSI C (also works for C++) the easiest way is the command scanf().
The sintax for the scanf is the following:

  scanf("%type",&variable);

  where type is the type of the value and of the variable deaclared earlier.

  the type are defined as :
   d : Decimal/Integer
   s : String
   f : float
  d : double
...

  Go check the scanf command on the tutorials on the Net. You will find lots
of things...

  SPY

Roger wrote:

> Hi everyone!
>
> I have one question! I know a command in Basic,but I can't use it in
> C++.Could anyone tell me how I make a input-command,so I can for example
> write in a name!
>
> Thanks..

--------------B9EE104BCE361AA0208E71CE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
There are several ways in which you can store a value in a variable, but
for the ANSI C (also works for C++) the easiest way is the command scanf().
<br>The sintax for the scanf is the following:
<p>&nbsp; scanf("%<i>type</i>",&amp;<i>variable</i>);
<p>&nbsp; where <i>type </i>is the type of the value and of the variable
deaclared earlier.
<p>&nbsp; the type are defined as :
<br>&nbsp;&nbsp; d : Decimal/Integer
<br>&nbsp;&nbsp; s : String
<br>&nbsp;&nbsp; f : float
<br>&nbsp; d : double
<br>...
<p>&nbsp; Go check the scanf command on the tutorials on the Net. You will
find lots of things...
<p>&nbsp; SPY
<p>Roger wrote:
<blockquote TYPE=CITE>Hi everyone!
<p>I have one question! I know a command in Basic,but I can't use it in
<br>C++.Could anyone tell me how I make a input-command,so I can for example
<br>write in a name!
<p>Thanks..</blockquote>
</html>

--------------B9EE104BCE361AA0208E71CE--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019