Hacking and Art => General Modding & Programming / Other Games => Topic started by: perkele on June 25, 2008, 09:32:38 pm

Title: string generator
Post by: perkele on June 25, 2008, 09:32:38 pm
ok , does anyone have a program that creates 20 digit strings and prints them into a text file
examble xxxx-xxxx-xxxx-xxxx-xxxx
lines must stay in their position
c++ source code will do also
Title: Re: string generator
Post by: M. O. on June 26, 2008, 10:26:20 pm
Just for-loop 1:20 and append a (char) floor rand to the string by every iteration. If you want the - you should either do two for loops 5x4 or make a if(k%4==0) ofile<<"-"; continue; check. However, using continue is usually a bad programming habit.

For text files you just use some function nobody remembers. #include <fstream> and then some output file variable def.