Solved

int value to ascii.

Posted on 1998-07-29
3
212 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
ID: 1251872
Edited text of question
0
 
LVL 2

Accepted Solution

by:
kellyjj earned 50 total points
ID: 1251873
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
ID: 1251874
then all you would have to do is then open up each file.  
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

733 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