Thread: Writting multiple files into a folder and reading all the files in a folder

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    117

    Writting multiple files into a folder and reading all the files in a folder

    I only know fstream and fprintf, both of which need a prenamed file or directory.

    What I want to do is write multiple files, i.e. 001.txt, 002.txt.

    i would assume that this involves something like:
    Code:
    for(int o = 0; o < 100; o++)
    {
         cout << o << ".txt";
    }
    Also something that would read everything from a dynamic folder

    i.e.
    Code:
    char directory[100];
    strcpy(directory, "12345")
    and that would open/write a directory (C:\\1\2\3\4\5)

    Hope that made sense :S
    Would appreciate someone pointing me to the right direction Thanks!
    Last edited by JonathanS; 03-21-2012 at 04:30 PM.
    My Ctrl+S addiction gets in the way when using Code Blocks...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading files from a folder
    By Saleem Jaffer in forum C Programming
    Replies: 1
    Last Post: 05-13-2011, 08:53 AM
  2. Copy files in to a different folder help
    By TaiL in forum C Programming
    Replies: 4
    Last Post: 10-15-2009, 01:45 PM
  3. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  4. get files in a folder and more
    By appleGuy in forum Windows Programming
    Replies: 3
    Last Post: 09-05-2006, 08:59 AM
  5. how to get names of files in folder
    By kiku in forum C++ Programming
    Replies: 3
    Last Post: 03-07-2005, 06:51 PM