/* ospwgen.c - old school password generator - billy 5.5.2022 */ #include #include #include #include int main(int argc, char *argv[]) { int rn; //initialize integer to hold random numbers char *cmd=argv[0]; //store command used to run program (for usage notice) char a_upper[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //initialize array of uppercase char a_upperc[]="BCDFGHJKLMNPQRSTVWXYZ"; //initialize array of uppercase consonants char a_upperv[]="AEIOU"; //initialize array of uppercase vowels char a_lower[]="abcdefghijklmnopqrstuvwxyz"; //initialize array of lowercase char a_lowerc[]="bcdfghjklmnpqrstvwxyz"; //initialize array of lowercase consonants char a_lowerv[]="aeiou"; //initialize array of lowercase vowels char a_digit[]="0123456789"; //initialize array of digits char a_symbl[]="!@#$%^&*()-+;:,."; //initialize array of symbols if (argv[1]){ //if argument 1 is not null srand(time(NULL)); //seed random number generator with date int alength=(int)strlen(argv[1]); //get length of command line argument 1 (format string) for (int i=0; i\n",cmd); printf("u = uppercase letter\n"); printf("l = lowercase letter\n"); printf("c = consonant\n"); printf("v = vowel\n"); printf("C = uppercase consonant\n"); printf("V = uppercase vowel\n"); printf("d = digit\n"); printf("s = symbol\n"); return 0; }