File string searching

This is a discussion on File string searching within the C++ Programming forums, part of the General Programming Boards category; I'm wanting my program to be able to search for a string within a file. I have been searching the ...

  1. #1
    System-7
    Join Date
    Nov 2005
    Posts
    65

    File string searching

    I'm wanting my program to be able to search for a string within a file. I have been searching the net but I have been unable to do so. Can anyone give me a direction to look or an example?

    Thanks,

    ...Dan

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,066
    Read the entire file into a std::string object and take advantage of the std::string::find() function. That should give you plenty of things to google.
    Sent from my iPadŽ

  3. #3
    System-7
    Join Date
    Nov 2005
    Posts
    65
    alright

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inheritance Hierarchy for a Package class
    By twickre in forum C++ Programming
    Replies: 7
    Last Post: 12-08-2007, 03:13 PM
  2. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM

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