-
Integer to print ASCII
Okay I have a program which finds the frequency's of numbers entered in a determined range and it prints out the frequency with a '*'. So if the frequency is four it should print ****. I have the frequency's stored in temp[0], temp[1], ..... So I can print the integer but how do I convert it to print multiple ASCII characters of '*'
Thanks!
-
void c2a( char c ){int x;for(x=0;x<c;x++)putc('*');}
Quzah.
-
Hi,
This should also solve your problem:
Code:
void ntoc(unsigned char c)
{
int n,count;
n=c; /* n is your character number in temp */
for(count=0;count<temp[n];count++,putc('*')) ;
/* temp[n] is so the frequency of you character */
}