Thread: simple dictioanry problem (newbies)

  1. #1
    Registered User
    Join Date
    Jan 2002

    simple dictioanry problem (newbies)

    I tried to define a dictionary array like this:

    AnsiString dictionary[]= {"bread", "juice", "water"...etc

    then as I was testing to see if I can refer to each word seperately, I tried:

    Edit1->Text=dictionary[2]; // to print out the word in the edit box

    hoping the word juice would come out! but only the letter 'r' came out from the word bread!
    how do I get the whole word 'juice"...etc

  2. #2
    I don't think AnsiString is a valid datatype or class, try
    String dictionary[] = {"bread", "juice", "water"...etc
    char *dictionary[] = {"bread", "juice", "water"...etc

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A simple file I/O problem
    By eecoder in forum C Programming
    Replies: 10
    Last Post: 10-16-2010, 11:00 PM
  2. Problem in very simple code
    By richdb in forum C Programming
    Replies: 22
    Last Post: 01-14-2006, 09:10 PM
  3. Simple File I/O problem
    By Ignited in forum C++ Programming
    Replies: 3
    Last Post: 01-07-2006, 10:49 AM
  4. Simple Initialization Problem
    By PsyK in forum C++ Programming
    Replies: 7
    Last Post: 04-30-2004, 07:37 PM
  5. Simple OO Problem
    By bstempi in forum C++ Programming
    Replies: 1
    Last Post: 04-30-2004, 05:33 PM