Solved

Counters

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
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 …
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now