Results 1 to 7 of 7

Thread: This won't compile for me

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145

    This won't compile for me

    What is wrong?

    #include <iostream>


    void main() {//if he insists on using void
    char word[25][1000];
    int d=0;
    while (word[d]!="eof"|d<999) {
    cout << "enter the word to sort or eof for terminate";
    cin >> word[d];
    d++;
    }

    }
    ICQ = 20476917
    AIM = Butnud

    Lets Talk!

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    try...
    PHP Code:
    #include <iostream> 

    using namespace std;

    void main()
    {
        
    char word[25][1000]; 
        
    int d=0

        while ((
    word[d]!="eof") || (d<999))
        { 
            
    cout << "enter the word to sort or eof for terminate"
            
    cin >> word[d]; 
            
    d++; 
        } 

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145
    okay now

    does this program fullfill the following question(s)?

    Write a program that inputs several lines of text and prints an alphabetical listing of each word in the text and how many times it occurred. Ignore any case differences (e.g., “Cat” and “cat” are the same word). Terminate input by signaling end-of-file from the keyboard. As a minimum requirement, you may assume there will be no punctuation marks and that exactly one space will separate words.
    ICQ = 20476917
    AIM = Butnud

    Lets Talk!

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Well, you've got the first part down somewhat, but it doesn't do any of the other stuff if that is your only code..
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145
    do u have aim or ICQ so you can help me?
    ICQ = 20476917
    AIM = Butnud

    Lets Talk!

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    No, but I can tell you to do a search here for 'split' and 'bubble sort' and you should find sime info to help you sort the individual words for each entry.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145
    nothing.
    grrrr

    I iwsh i knew what I was doing!
    ICQ = 20476917
    AIM = Butnud

    Lets Talk!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width