473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problem of graphics.

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

Sep 18 '07 #1
3 2288
vicky pisze:
what should i do to convert the integer
into const char far*.
Probably itoa function is what you want (or snprintf).

ch.
Sep 18 '07 #2
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
Sep 18 '07 #3
LPoD <ch****@pfff.irc.pl.wytnij.pfffwrites:
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) ks***@mib.org <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"
Sep 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: BlackHawke | last post by:
My name is Nick Soutter, I own a small game development company (www.aepoxgames.net) making our first game (www.andromedaonline.net) in java. I am writing because we are having a very...
11
by: Sagaert Johan | last post by:
I have made a custom control that draws a rectangle when the mouse is down, and does nothing when the mouse is up. I set/reset a flag in MouseDown/Mouse up and use this to do the drawing in the...
1
by: Bardo | last post by:
Hi all Ok first of me new to C#sharp. At the moment I am still learning the language. The problem I am running into is that I just can't seem to get a picture embedded into my program and then...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
1
by: jty202 | last post by:
I know alot of people have the problem with indexed pixel format. I hope someone can show me the solution to this.I am have problem with graphics with the following code giving the error: "A...
1
by: Lars Netzel | last post by:
Hi! In VB.NET want to draw my own items in a ComboBox I have added a ComboBox to the Form with this. -----------------------------------------------------------------------------------...
2
by: ameshkin | last post by:
I'm having all kinds of visual problems using dreamweaver's built in query builder. I have 4 different categories. Right. I want to show ten records from each category of items in a mysql...
4
by: Galen Somerville | last post by:
I have a real timing problem. This involves getting data from a USB device via an ActiveX dll and drawing trace lines on the screen via a UserControl. The USB device sends six sets of pixel info...
2
by: Carl Heller | last post by:
Working in VS2003, .Net 1.1 I'm working on a project where I compare data between two databases. This is a lengthy process, and very data intensive, so I decided to create a class, and thread...
1
by: =?Utf-8?B?Y3JhbmtlX2JveQ==?= | last post by:
Hi Folks, I'm not sure where this post belongs since I'm using managed vc.net, but the issue is around GDI BitBlt. Here is a summary of the problem: - I am trying to copy a bitmap of my main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.