Like Tree1Likes
  • 1 Post By std10093

Searching for a string in an 'dictionary' array

This is a discussion on Searching for a string in an 'dictionary' array within the C Programming forums, part of the General Programming Boards category; Hello I'm having some problems with this. I am trying to search for a string, via user input, through a ...

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    8

    Searching for a string in an 'dictionary' array

    Hello I'm having some problems with this. I am trying to search for a string, via user input, through a dictionary to see if the word matches.
    Code:
    typedef struct{
        bool found;
        char letters[LETTERS + 1];
    }
    word;
    
    
    // defines a dictionary as having a size and an array of words
    struct
    {
        int size;
        word words[WORDS];
    }
    dictionary;
    The word is an array of letters so how would I check to see if a string is equal to the word array inside the dictionary?

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,655
    intex likes this.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    8
    Thankyou very much!

  4. #4
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,655
    You are welcome.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. convert Dictionary to array
    By Dale in forum C# Programming
    Replies: 4
    Last Post: 11-28-2011, 02:35 AM
  2. Replies: 9
    Last Post: 08-23-2010, 02:31 PM
  3. Dictionary into a 2d Char Array... Problems.
    By Muzzaro in forum C Programming
    Replies: 10
    Last Post: 12-02-2006, 11:34 AM
  4. partially checking a string against a dictionary
    By axon in forum C++ Programming
    Replies: 2
    Last Post: 03-11-2003, 05:16 PM
  5. Not getting good result searching an array of string.
    By cazil in forum C++ Programming
    Replies: 5
    Last Post: 02-12-2002, 10:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21