Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Counters

Posted on 1998-03-18
1
Medium Priority
?
213 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

618 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