Thread: Can a scanf function see a number input "1234" as 4 separate numbers?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    13

    Can a scanf function see a number input "1234" as 4 separate numbers?

    I am doing an ISBN digit check program. I'm not actually in school, but it's on the curriculum in a lot of C classes. Naturally want to be able to do it.

    I am trying to figure it all out, having tried twice and failed. My biggest hurdle/question is:

    Can you have a "scanf" function that sees the user input/ISBN like this: 1234567890.

    With no spaces or dashes, and have the program not treat the ISBN input as one number? Have the program understand that it should take each digit and place each one in a slot on an array? So, using the above number, it would get: isbn[0] = 1, isbn[1] = 2, etc.

    I have no program to show because I have scrapped them all, seeing as how i was going about it in completely the wrong way. I want to start fresh with new knowledge.
    Last edited by Krash005; 10-06-2009 at 11:29 AM. Reason: Prematurely hit enter.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  2. adding a number to a number
    By bigmac(rexdale) in forum C Programming
    Replies: 11
    Last Post: 10-24-2007, 12:56 PM
  3. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Creating a student grade book-how?
    By Hopelessly confused in forum C Programming
    Replies: 5
    Last Post: 10-03-2002, 08:43 PM