User Profile

Collapse

Profile Sidebar

Collapse
jla1357
jla1357
Last Activity: Sep 12 '07, 02:54 PM
Joined: Sep 11 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • jla1357
    replied to Switch statement that calls functions
    in C
    thanks, this is a start to what I was going for, it's incomplete but hopefully it can give the idea of what I am trying to do. If you see anything wrong please tell me.

    Code:
    bool userChoice(WordInfo list[LIST_SIZE])
    {
    	char choice;
    
    	cout << "Please select a choice from the menu below: " << endl;
    	cout << "F)ind a word by index" << endl;
    	cout <<
    ...
    See more | Go to post

    Leave a comment:


  • jla1357
    started a topic Switch statement that calls functions
    in C

    Switch statement that calls functions

    I have to create a switch statement that calls a statement when one of the choices is selected. i.e.

    Code:
    cout << "Please select a choice from the menu below: " << endl;
    	cout << "F)ind a word by index" << endl;
    	cout << "S)earch for a word" << endl;
    	cout << "O)utput the number of words" << endl;
    	cout << "E)xit"<<
    ...
    See more | Go to post

  • jla1357
    replied to Reading in a file to an array
    in C
    I have gotten the program to read the words of the file, however, I think there are errors in my code to keep track of multiplicity of the word or add it to a new index
    [code=cpp]
    bool readWords(WordI nfo wordList[], int &numWords)
    {
    ifstream inf;
    if (!openFile(inf) ) // openFile returns false if file not opened
    return(false);

    numWords=0;
    string tempWord;
    int idx;...
    See more | Go to post
    Last edited by sicarie; Sep 11 '07, 05:51 PM. Reason: Code tags

    Leave a comment:


  • jla1357
    started a topic Reading in a file to an array
    in C

    Reading in a file to an array

    In my program I need to read in a file, search for 100 unique words, and count how many times a found word has been found all by using an array. This is what I have so far, but when the file is found it simply returns zero.

    please any help would be great

    [CODE=cpp]#include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;
    const int LIST_SIZE = 100;...
    See more | Go to post
    Last edited by Ganon11; Sep 11 '07, 01:31 PM. Reason: Please use the [CODE] tags provided.
No activity results to display
Show More
Working...