Thread: reading two files and comparing

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    1

    reading two files and comparing

    hi, how to read the two files. onefile contains the words like
    word1 meaning
    word2 meaning
    and another file contains the sentences like
    word1 word2 ......
    word 3 word4 .....
    1.I have to read the sencond file line by line and split into words store those words in buffer. 2.compare the each word in buffer with each word in the first file and replace it with that meaning.
    3.repeat the process for all other lines in the second file.
    I am new to files topic in c. I am able to read the strings and store it in array. My question is How can i read line by line and then split. ?

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Look up... fgets(), strtok(), strcmp()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Comparing two files
    By 843 in forum C Programming
    Replies: 7
    Last Post: 11-24-2010, 12:50 PM
  2. Reading and comparing in an array
    By ammochck21 in forum C++ Programming
    Replies: 14
    Last Post: 12-09-2006, 12:46 AM
  3. comparing two files
    By afzan in forum C++ Programming
    Replies: 2
    Last Post: 03-02-2005, 01:09 PM
  4. Comparing two files
    By pxleyes in forum C Programming
    Replies: 12
    Last Post: 09-24-2004, 08:06 AM
  5. Comparing Files
    By snowy101 in forum C++ Programming
    Replies: 3
    Last Post: 06-19-2002, 10:43 AM