Original Post
in a for loop i want to creat multiple text files but i just can figure it out i used this code but it olny creates one char* basename = "textfile"; for(int q = 1; q < 1002;q++) { cout << "Creating text file" << q <<"...." <<endl; for( int i = 0; i < 1000;i++) { char filname [256] = {0}; sprintf(filname,"%s_%i.txt",basename,i); poop.open(filname); pee.open(filname); } } poop.close(); pee.close(); } but it wont work