two questions

This is a discussion on two questions within the C++ Programming forums, part of the General Programming Boards category; There are a couple of symbols I've used blindly and I'd like to know what they do. They are: %d ...

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    7

    Question two questions

    There are a couple of symbols I've used blindly and I'd like to know what they do. They are: %d and %s. I couldn't find a clear reference when I was searching that showed what the symbols that start with % mean.

    Also, is there a list of all the available features of C++ without using libraries? Just a reference that shows all the keywords built into the language.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >I couldn't find a clear reference when I was searching that showed what the symbols that start with % mean.
    Have you tried the FAQ?

    >Also, is there a list of all the available features of C++ without using libraries?
    The only ones I know of are reference books on C++ or the C++ standard. You can search google for the draft standard, which is free, but not completely authoritative because it's only a draft.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    7
    I'm sorry, the FAQ is helpful, but I still don't understand. The funtion goes like this:
    Code:
    <allegro.h>  //using the allegro library
    ...
    textprintf(..., "(&#37;d, %d)", mouse_x, mouse_y);
    this causes it to show mouse_x in the first %d spot, and mouse_y in the second. Why?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,506
    I imagine it's just like regular printf(), except it outputs to some graphic surface rather than the console.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 08:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM

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