Solved

int value to ascii.

Posted on 1998-07-29
3
200 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

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…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

770 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