Thread: Displaying an int in graphics mode?

  1. #1
    ~Team work is the best!~ wakish's Avatar
    Join Date
    Sep 2005
    Posts
    85

    Displaying an int in graphics mode?

    Hi..thanks for taking time to at least have a look at my problem:

    My program is all in graphics mode - <graphics.h> from borland
    I want to output/display an "int" on the screen.
    For strings i make use of outtext or outtextxy, but how do you do that for an int?
    Can you help me please?
    Thanks for your generous help!

    Kind Regards!
    # If you want to be happy, think of others.
    # If you want to be miserable, think of yourself

    ~~~Team work is the best!~~~

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    169
    One way would be to convert your int into a string then.
    one of the printf() functions does that IIRC

  3. #3
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    Yes, you'd want to use sprintf(). That's probably what glo was looking for
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  4. #4
    ~Team work is the best!~ wakish's Avatar
    Join Date
    Sep 2005
    Posts
    85
    but the problem is i'm using linked-list..and it's inevitable to use int...
    i thought there would be something similar like outtext,,i have searched for it..but in vain..
    is there any special libraries on the net for it? If you came across it?
    # If you want to be happy, think of others.
    # If you want to be miserable, think of yourself

    ~~~Team work is the best!~~~

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    169
    You can keep your int, just make sure when you want to print it using your string receiving function, convert the int into a string, then call your function with that string.
    Practically, all you need is to declare a char array[7], so its not a matter of inevitability.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NEED HELP READING FILE and PRINTING
    By geoffr0 in forum C Programming
    Replies: 4
    Last Post: 04-16-2009, 05:26 PM
  2. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  3. Debug Error Really Quick Question
    By GCNDoug in forum C Programming
    Replies: 1
    Last Post: 04-23-2007, 12:05 PM
  4. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 05:26 PM
  5. A Simple (?) Problem
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 10-12-2001, 04:28 AM