#include "stdio.h" #include "stdlib.h" #include "time.h" int main(int argc, char **argv){ printf("Arguments: %d \n", argc); srand((unsigned int)(time(NULL))); //char *ptr; //int num; int length = 6;//(int) strtol(argv[1], &ptr, 10); printf("Password length: %d \n", length); char password[length]; int i; for(i = 0; i < length; i++){ password[i] = 33 + rand() %94; } password[i] = '\0'; printf("Generated Password with length %d: %s \n", length, password); return 0; }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more