Thread: Read two variable on one line

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    1

    Read two variable on one line

    I trying to read two variable on one line bue i cant figure how.

    Here is a example of what im trying to do

    Code:
    scanf("%d %d", &i &j);  // Example output: 25 45

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    What about the missing comma?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Salem View Post
    What about the missing comma?
    Comma-tose code?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Read text file line by line and write lines to other files
    By magische_vogel in forum C Programming
    Replies: 10
    Last Post: 01-23-2011, 10:51 AM
  2. How to read a line and put in cahr variable
    By SasDutta in forum C Programming
    Replies: 1
    Last Post: 03-31-2010, 11:29 AM
  3. Read strings line by line until Ctrl+C is pressed
    By r00t in forum C Programming
    Replies: 25
    Last Post: 11-17-2009, 04:18 AM
  4. Read first line of a file and store in a variable
    By Saeid87 in forum C Programming
    Replies: 5
    Last Post: 06-19-2009, 11:27 AM
  5. Reading a buffer line by line, while using system read
    By Hammad Saleem in forum C Programming
    Replies: 9
    Last Post: 05-27-2008, 05:41 AM

Tags for this Thread