Solved

Counters

Posted on 1998-03-18
1
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

724 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