Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

cakjsd

#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;
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.