This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Array of string

I use a AT89S52 and programming with KEIL C51.How can I implement a look-up table for string ?

My array example :
array[0] = "ABC"
array[1] = "Hello"
array[2] = "Good morning"
array[3] = "Good night"

Parents
  • "Just to pick a nit what do you mean by array[0] = {"ABC"};"

    He didn't write the curly braces; he actually wrote:

    array[0] = "ABC"
    Which is fine as an executable statement, provided that there is a suitable definition of the array...

    "Do you mean to write array0[] = {"ABC"};"

    That would be a definition (with initialisation) of an array of chatacters - a string - not an array of strings, wouldn't it...?

    Again, all this is basic stuff that would be covered by a good text book.
    (or 'C' programming class)

    Without putting in the foundational text book work on the basics, everything else will be built upon sand...

Reply
  • "Just to pick a nit what do you mean by array[0] = {"ABC"};"

    He didn't write the curly braces; he actually wrote:

    array[0] = "ABC"
    Which is fine as an executable statement, provided that there is a suitable definition of the array...

    "Do you mean to write array0[] = {"ABC"};"

    That would be a definition (with initialisation) of an array of chatacters - a string - not an array of strings, wouldn't it...?

    Again, all this is basic stuff that would be covered by a good text book.
    (or 'C' programming class)

    Without putting in the foundational text book work on the basics, everything else will be built upon sand...

Children