Search:

Type: Posts; User: haz115

Search: Search took 0.02 seconds.

  1. Replies
    4
    Views
    1,869

    Thank you, how could I write the code to read...

    Thank you,

    how could I write the code to read the words from the file?
    would it be something like this:

    /* getword */
    int getword(char *word, int lim)
    {
    int c, fgetc(input_ptr);
    ...
  2. Replies
    4
    Views
    1,869

    I am really bad at this, could you please help...

    I am really bad at this, could you please help me! so far I have:

    #include <stdio.h>
    #include <ctype.h>
    #include <string.h>

    struct wordcount {
    int count;
    char *word[64];
    }
  3. Replies
    4
    Views
    1,869

    Populate an array with words from a file

    Could anyone give me some help with the following task (without using a binary tree)?

    I have to write a function that reads a file of words and populates the array "wordlist" with the words in the...
  4. Replies
    4
    Views
    1,075

    Thanks, I am trying to do it without using a...

    Thanks, I am trying to do it without using a binary tree (thats the next question!). I have some code which i think does a similar job to the program I am trying to create but reads the characters...
  5. Replies
    4
    Views
    1,075

    need help with word count

    Thanks, I am trying to write a function that reads a file of words and populates the array "wordlist" with the words in the file, and the count of how many times each occurs.
    I then have to use this...
  6. Replies
    4
    Views
    1,075

    Help - how do i define a structure?

    I am trying to define a structure called "wordcount" which has 2 fields: a character array of length 64 called "word" and an integer called "count". How could I do this?

    Also, how would I declare...
  7. Replies
    3
    Views
    1,666

    ok, would it be something like this: while...

    ok, would it be something like this:

    while ((ch=fgetc(input_ptr))!=EOF))
    {
    if ((ch == 0x20) /*or should I write ==' ' ?*/
    ++count
    }

    printf("The number of words is...
  8. Replies
    3
    Views
    1,666

    Text analysis problem

    How could I write a program that reads a file of words (assumed to be in lower case letters) and prints out the total number of words in the file?

    Would it be something like this?:


    #include...
  9. Replies
    13
    Views
    3,581

    Thanks again, OK last question..... how...

    Thanks again,

    OK last question.....

    how could i get the program to read a file of words(assumed to be in lower case) and print out the the total number of words?

    I guess i wouldn't need the...
  10. Replies
    13
    Views
    3,581

    Thank you everybody so much! How could I...

    Thank you everybody so much!

    How could I modify the program so that instead of converting the characters, it copies all the lower case letters and white space characters to the output file,...
  11. Replies
    13
    Views
    3,581

    Whereabouts exactly, and how?

    Whereabouts exactly, and how?
  12. Replies
    13
    Views
    3,581

    Text analysis problems - need help!

    Can anyone please help?

    I've been given the problem:

    Write a C program that reads text from an input file, converts
    any upper case letters to lower case, and writes the resulting text to an...
  13. Replies
    1
    Views
    1,357

    Text analysis problems - need help!

    Can anyone help with the following problems?

    1.a) Write a C program that reads text from an input file, converts any upper case letters to lower case, and writes the resulting text to an output...
Results 1 to 13 of 13