Solved

int value to ascii.

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
c language help - file paths 7 150
List out all word 7 317
Problem to show menu 5 93
valid enum? 6 75
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

828 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