initializing table of strings

From: Rafi Kfir (rafi.kfir_at_telrad.co.il)
Date: 04/29/04


Date: 29 Apr 2004 04:44:06 -0700

I'n confused...
 This will work:
    char *p;
    p = "Hello Wrold";

But this does not word";
    char **p;
    *p = "Hello World";

1) Can somebody explain this to me.

2) What solution can you offer me if my task is filling a table strings
   (3 lines with 3 strings in each line). This has to be done NOT in the
   decleration but in the program body. (reason is because I need to fill
   the same table with different data few times).
       The table is:
         str11, str12, str13,
         str21, str22, str33,
         str31, str32, str33
   The strings varies in length.
   I began by delcaring char **Table, but then, any attempt to initialize the
   tables (*Table = "ABC") gave me errors.

Thank you very much



Relevant Pages

  • Re: Using ZeroMemory with strings?
    ... > I have a record which contains a number of floats and strings. ... Finalize has a complementary routine called Initialize. ... to call it after allocating memory for your record. ... necessary to call Initialize if you allocate the record with New, ...
    (borland.public.delphi.language.objectpascal)
  • Re: What type of object for this?
    ... and then have static fields as you do. ... I would have a type constructor which would initialize a ... ability to loop blindly through these fields (strings) and get their ... I'd have to know what the index of hand is and even then, intellisense ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Modem initialization strings
    ... > modem initialization strings set through the registry. ... > is an enumerated sequence of strings that are used to initialize the ... > Jose Luis Balsera ...
    (microsoft.public.pocketpc.developer)
  • Re: C Static char* Array Question
    ... My question is how do I clean up the old value? ... I'm kind of assuming that the compiler is doing something with the ... Initialize the "DataThatCanChange" manually at the start of the ... any bigger than the old strings. ...
    (comp.lang.c)
  • Simple question with array of strings
    ... with C), it drives me crazy. ... the strings can be of different length and the array will be ... initialize the array, I preffer that it will take as little text space ...
    (comp.lang.cpp)