problem of graphics.

Discussion in 'C Programming' started by vicky, Sep 18, 2007.

  1. vicky

    vicky Guest

    hi all,

    i am devloping a "Sudoku solver & genertor" project in C.
    while displaying the numeric(integer) on the screen i use
    function.
    outtextxy(r,c,value);
    where r & c are cordinates on the screen(X,Y)-integer and
    value is numeric(integer) that i want to display on required box.
    but outtextxy(r,c,value) doesn't support integer as value it
    should be const char far*. what should i do to convert the integer
    into const char far*.
    and if i typecast integer to char then still it shows an error
    i.e. Cann't convert int into const char far*.

    what should i do to display the integer using outtextxy() function or
    something else
    vicky, Sep 18, 2007
    #1
    1. Advertising

  2. vicky

    LPoD Guest

    vicky pisze:

    > what should i do to convert the integer
    > into const char far*.


    Probably itoa function is what you want (or snprintf).



    ch.
    LPoD, Sep 18, 2007
    #2
    1. Advertising

  3. vicky

    Flash Gordon Guest

    vicky wrote, On 18/09/07 06:43:
    > hi all,
    >
    > i am devloping a "Sudoku solver & genertor" project in C.
    > while displaying the numeric(integer) on the screen i use
    > function.
    > outtextxy(r,c,value);


    outtextxy is not standard C and so is off topic here. However, you
    provide enough information about it to allow the question to be answered.

    > where r & c are cordinates on the screen(X,Y)-integer and
    > value is numeric(integer) that i want to display on required box.
    > but outtextxy(r,c,value) doesn't support integer as value it
    > should be const char far*. what should i do to convert the integer
    > into const char far*.
    > and if i typecast integer to char then still it shows an error
    > i.e. Cann't convert int into const char far*.


    far is not part of standard C either and so off topic here.

    > what should i do to display the integer using outtextxy() function or
    > something else


    You need to convert your integer value to a string. In standard C the
    normal way to do this is to use sprintf with appropriate values. How you
    then get a far pointer to your string instead of a normal pointer is
    another matter and for that you will have to ask somewhere that your
    specific implementation is topical. Or move to a vaguely modern compiler
    that does not use far and probably uses a different method to put
    strings at specific locations on the screen.
    --
    Flash Gordon
    Flash Gordon, Sep 18, 2007
    #3
  4. LPoD <> writes:
    > vicky pisze:
    >> what should i do to convert the integer
    >> into const char far*.

    >
    > Probably itoa function is what you want (or snprintf).


    There is no itoa function in standard C.

    Since the OP is doing a Sudoku program, he presumably only needs to
    deal with integers from 1 to 9.

    Hint: '0' + 5 == '5' (the language guarantees that the numeric values
    of the digit characters are contiguous).

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Sep 18, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    1
    Views:
    2,273
    Hadar
    Aug 28, 2003
  2. DBC User

    2d Graphics problem - Help!

    DBC User, Apr 21, 2006, in forum: Java
    Replies:
    4
    Views:
    427
    DBC User
    Apr 21, 2006
  3. Paul

    Inline graphics problem

    Paul, Aug 29, 2004, in forum: HTML
    Replies:
    5
    Views:
    405
    Jim Higson
    Aug 30, 2004
  4. Mahesh Kumar. R
    Replies:
    3
    Views:
    444
    Martijn Lievaart
    Jan 6, 2004
  5. Karl Max

    2D vector graphics Problem

    Karl Max, May 29, 2005, in forum: Python
    Replies:
    5
    Views:
    352
    Fredrik Lundh
    May 30, 2005
Loading...

Share This Page