Hello! I've got a little problem... I want to make a program which puts 10 random character, but the characters should NOT be digits.
#include <ctime>
#include <stdio>
#include <iostream>
using namespace std;
int main()
{
time_t t;
time(&t);
srand(t);
int i,c;
char ch;
printf("Generating 10 random characters...\n");
for(i=1;i<=10;i++)
{
c=rand();
ch=c;
printf("%c ",ch);
}
printf("\n");
system("PAUSE");
return 0;
}
I've got an idea, I could add a while and say
while(ch<ASCII HERE&&ch>ASCII HERE)
{
//generating random characthers
}
But I don't know how to use the ASCII... help?