% thingy

This is a discussion on % thingy within the C Programming forums, part of the General Programming Boards category; Hey, since i am new at this stuff, i was wonder if it mattered what kind of % thing (ex. ...

  1. #1
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21

    Question % thingy

    Hey,

    since i am new at this stuff, i was wonder if it mattered what kind of % thing (ex. %f) to enter info. like -

    scanf("%f",blah)
    printf("well, %f right back to you!!",blah")

    plz hpl,
    Yeah

  2. #2
    Registered User
    Join Date
    Feb 2005
    Posts
    12
    Yes and no. Yes b'cos, if you've got an integer and trying to printf() an integer, you need to do a %d. By no I meant, if you've a char type and you do a %d printf() for that it'll return you the ASCII value of the character.
    eDIT:
    This topic might have been dealt with the FAQ. So, lookup there as well, you'll find more on it with examples.

  3. #3
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21

    Talking

    thanks,

    another,
    what are all the % thingys, if you cant tell me, tell me where i can find them!

    Thanks,
    Yeah

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,639
    C/C++ Reference's printf() page would be useful.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21
    thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Math Parser thingy.....it's kinda cool
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 06-17-2005, 01:53 PM
  2. Premature stoppage type thingy with tags
    By ADR14N in forum C++ Programming
    Replies: 3
    Last Post: 05-16-2004, 12:21 AM
  3. DirectX Version Thingy
    By gnu-ehacks in forum Game Programming
    Replies: 1
    Last Post: 01-24-2002, 10:30 AM
  4. The A-Bomb of Board Discussion: --
    By Aran in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 10-21-2001, 10:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21