problem of graphics.

V

vicky

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
 
F

Flash Gordon

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.
 
K

Keith Thompson

LPoD said:
vicky pisze:

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).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top