Thread: Not sure where to start with this project

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    1

    Not sure where to start with this project

    Hi, hopefully someone can offer some advice or tips for my project?
    A little stumped on where to start, I've been reading the texts and I guess I'm not absorbing it all.

    "Write a C program that reports how many lines, words, and characters in an input text file, and also makes a sorted list of all words found in it. You are required to provide the text file. Write the sorted list to an output file, along with the number of times each word appeared in the input file. For the purpose of this program, a word consists of a consecutive sequence of any characters except white space characters."

  2. #2
    Registered User
    Join Date
    Dec 2010
    Posts
    2
    You need to learn file handling in C. Google for "File handling in C" you will get tons of results.



    - RajX
    Last edited by Salem; 12-09-2010 at 12:12 AM. Reason: Snip fake sig

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So do it in small steps

    - count the characters
    - count how many of them are \n (this is the number of lines)
    - count how many are spaces (this is crudely the number of words)
    - etc etc
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HELP! 1st Project!
    By Zionstorm in forum C++ Programming
    Replies: 3
    Last Post: 09-15-2008, 09:36 AM
  2. Dynamic Binding
    By gpr1me in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2006, 09:01 AM
  3. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM
  4. have no idea where to start (not a project)
    By misplaced in forum C++ Programming
    Replies: 2
    Last Post: 10-10-2004, 06:48 PM
  5. Need some help with a basic tic tac toe game
    By darkshadow in forum C Programming
    Replies: 1
    Last Post: 05-12-2002, 04:21 PM