opening a .txt file, and placing random words, random places

This is a discussion on opening a .txt file, and placing random words, random places within the C++ Programming forums, part of the General Programming Boards category; right, here's the deal.. I wan't to write random words, on random places, to a *.txt file. How can I ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    8

    opening a .txt file, and placing random words, random places

    right, here's the deal.. I wan't to write random words, on random places, to a *.txt file.

    How can I store some words (it must be in some kind of array-thingie, not like stored in a *.txt)?

    Now, these words should be outputted to random places in the text (though only places which is empty)


    Like this:

    words: " bla "," blaah "," hum "

    text before: howdy sir , how are you today ?

    text after: howdy sir blaah , how hum are you bla today ?


    ps. I know how to open files for reading.
    Last edited by sh0rty; 12-13-2002 at 06:45 PM.

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    use std::istream::seekg() or use std::fseek() in C.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  2. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 02:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21