Solved

int value to ascii.

Posted on 1998-07-29
3
182 Views
Last Modified: 2010-04-15
I am trying to generate a list of numbered filenames something like:
file0.bmp
file1.bmp
file2.bmp
.
.

I am trying to use a for loop on i and I was wondering how to get the value in i converted to ascii.

If you do 'i' it gives you the ascii for i and not the ascii for the value in i (0,1,2,...), so you get:
filei.bmp
filei.bmp
.
.

Seems simple enough,
Jon

Thanks
0
Comment
Question by:klingej
  • 2
3 Comments
 

Author Comment

by:klingej
Comment Utility
Edited text of question
0
 
LVL 2

Accepted Solution

by:
kellyjj earned 50 total points
Comment Utility
Here is one way of doing it:

for (i=0;i<SOME_LIMIT;i++)
{
   sprintf(fname,"file%i.bmp",i);
}
0
 
LVL 2

Expert Comment

by:kellyjj
Comment Utility
then all you would have to do is then open up each file.  
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

728 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

9 Experts available now in Live!

Get 1:1 Help Now