Thread: printf() and scanf()

  1. #1
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209

    printf() and scanf()

    I'm trying to learn the Win32 API and I've realized I should have started with C instead of C++ and I was wondering if someone could point me to a tutorial (or anything, even like a reference page) that teaches every aspect of using printf() and scanf(). I basically know how to use them, but I was looking through some code someone had posted in this forum and was like, huh? To be more specific, here is the exact code:

    Code:
    fscanf(f, "%[^\t]\t%d\t%c\n", p[num].cprnr, &p[num].prio, &p[num].skade)
    I'm confused about what the bold blue print means - it's supposed to be inputting a string but I've never seen that before.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    The scanf family is an interesting beast. One of these days I may understand it fully. Until then I try very hard to use references to understand what I can. Here's one:
    http://dinkumware.com/manuals/reader...an.html#%[

    A short version of that might be to look for a string delimited by a tab character and write as many non-tab characters (and a terminating null) into the string corresponding to this directive.
    Last edited by Dave_Sinkula; 02-06-2006 at 10:45 PM.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  3. Newb Help: Full Arrays and Functions
    By LycanGalen in forum C Programming
    Replies: 5
    Last Post: 01-31-2008, 08:35 PM
  4. Please help debug
    By Wexy in forum C Programming
    Replies: 2
    Last Post: 11-11-2002, 12:40 AM
  5. help with switch statements
    By Wexy in forum C Programming
    Replies: 3
    Last Post: 11-06-2002, 05:44 PM