Solved

Counters

Posted on 1998-03-18
1
185 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 50 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

777 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