Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Random MAC address

Name: Anonymous 2013-07-30 18:37

Thought this might be useful. Enjoy.



#include <stdio.h>
#include <stdlib.h>


    main () {
  
    printf("Starting generation sequence!\n");
      int i,tp;
   
      srand(time(NULL) + getpid());
    printf("\nYour generated MAC address is: ");
 
  printf("00:");
  for (i=0; i<5 && (tp=rand()%32) > -1; i++) printf("%s%X%s",
                                       tp<16 ? "0" : "",
                                       tp,
                                       i<4 ? ":" : "\n");
return 0;
}

Don't change these.
Name: Email:
Entire Thread Thread List