how to use scanf ?

need to learn how to use scanf function

Page 1 of 1

4 Replies - 4674 Views - Last Post: 31 January 2010 - 07:11 PM Rate Topic: -----

#1 dhenning3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-January 10

how to use scanf ?

Posted 31 January 2010 - 06:43 PM

I'm so new I don't even know what it means to "post your code here"

All I've done successfully in C++ is use the printf function to reveal a quotation on a black screen.
Now my assignment requires use of scanf function... need to convert keyboard character to ASCII code.

PLEASE help!
Is This A Good Question/Topic? 0
  • +

Replies To: how to use scanf ?

#2 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6600
  • View blog
  • Posts: 30,792
  • Joined: 10-May 07

Re: how to use scanf ?

Posted 31 January 2010 - 06:51 PM

It's rather easy to use scanf, it's the same syntax as printf.
Was This Post Helpful? 0
  • +
  • -

#3 xTorvos  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 61
  • View blog
  • Posts: 271
  • Joined: 23-October 09

Re: how to use scanf ?

Posted 31 January 2010 - 07:07 PM

Cplusplus.com is your friend (as well as Wikipedia and Google).

http://cplusplus.com...y/cstdio/scanf/
Was This Post Helpful? 0
  • +
  • -

#4 dhenning3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-January 10

Re: how to use scanf ?

Posted 31 January 2010 - 07:10 PM

View Postno2pencil, on 31 Jan, 2010 - 05:51 PM, said:

It's rather easy to use scanf, it's the same syntax as printf.


so what's it's purpose? why must it follow printf?
how is it used to convert keyboard characters to ASCII?
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6600
  • View blog
  • Posts: 30,792
  • Joined: 10-May 07

Re: how to use scanf ?

Posted 31 January 2010 - 07:11 PM

scanf is used to specify the input value given at the command console by the user.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1