?
Solved

Counters

Posted on 1998-03-18
1
Medium Priority
?
216 Views
Last Modified: 2013-12-25
Hi all,

I'm creating a counter form my site. I can keep track of the counter value itself but what I'm having help with is how to put the individual number gifs together to create a whole number. For example, if my counter has reached 1234, how do I put 1.gif, 2.gif, 3.gif and 4.gif together to create 1234.gif?

By the way, I doing this in C. Any help would be appreciated.
Thanks
0
Comment
Question by:vorlon
1 Comment
 
LVL 5

Accepted Solution

by:
julio011597 earned 100 total points
ID: 1832176
What about this way:

--//--
int count = 1234;
char buff[10]; /* up to 9 cyphers */

char *curs;

sprintf(buff, "%d", count);
for(curs=buff; *curs; curs++)
  printf("<IMG SRC=\"%c.gif\">", *curs);
--//--

HTH, julio.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question