int and char?

M

Mohsen

Hello everybody,
I have an array of numbers that I want to put them in a string. I have
an example that you could complete it if you could or just let me know
how I can do that.
Thank you very much,
MJ

#include <stdio.h>

#define I 10
#define C 10

int main()
{
int II;
char CC[C];
int i;
int c;

for(i=0;i<10;i++)
{
II=i+1;
printf("%d %d\n",i,II);
}

/* the following part is not working? */
for(c=0;c<10;c++)
{
CC[c]=char(II[c]);
printf("%d %c\n",II[c],CC[c]);
}
}
 
M

mlimber

Mohsen said:
Hello everybody,
I have an array of numbers that I want to put them in a string. I have
an example that you could complete it if you could or just let me know
how I can do that.
Thank you very much,
MJ

#include <stdio.h>

#define I 10
#define C 10

int main()
{
int II;
char CC[C];
int i;
int c;

for(i=0;i<10;i++)
{
II=i+1;
printf("%d %d\n",i,II);
}

/* the following part is not working? */
for(c=0;c<10;c++)
{
CC[c]=char(II[c]);
printf("%d %c\n",II[c],CC[c]);
}
}


See the FAQs:

http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.1

Cheers! --M
 
D

Default User

Mohsen said:
Hello everybody,
I have an array of numbers that I want to put them in a string. I have
an example that you could complete it if you could or just let me know
how I can do that.

Don't multi-post. I already answered this on comp.lang.c. Pick a
language BEFORE you do anything else.




Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top