Hello, I need some help doing this. What I need is a dynamic array of dynamic strings. And I wouldn't be sure how to to get at the values. I thought something like this:
: Hello, I need some help doing this. What I need is a dynamic array of dynamic strings. And I wouldn't be sure how to to get at the values. I thought something like this: : : [code]char *(*aszWords); : [/code] : : or am I barking up the wrong tree altogether?
Well, if this is C, then that is correct, but the parentheses are unnecessary. The compiler is already parsing the declaration like that. Check the C FAQ (second link in my signature) for some different approaches to this problem.
If this is C++, then you would much rather use a std::vector.
What the heck is that identifier supposed to stand for? I understand the 'Words' part, but 'asz'? Are those for Asian words or something?
: : Hello, I need some help doing this. What I need is a dynamic array of dynamic strings. And I wouldn't be sure how to to get at the values. I thought something like this: : : : : [code]char *(*aszWords); : : [/code] : : : : or am I barking up the wrong tree altogether? : : Well, if this is C, then that is correct, but the parentheses are unnecessary. The compiler is already parsing the declaration like that. Check the C FAQ (second link in my signature) for some different approaches to this problem. : : If this is C++, then you would much rather use a std::vector. : : What the heck is that identifier supposed to stand for? I understand the 'Words' part, but 'asz'? Are those for Asian words or something? : : : HTH, : Will : -- : http://www.tuxedo.org/~esr/faqs/smart-questions.html : http://www.eskimo.com/~scs/C-faq/top.html : http://www.parashift.com/c++-faq-lite/ : http://www.accu.org/ : : :
Hello,
the "asz" is a naming convention.... a : array sz : string zero ( NULL terminated ).... p : pointer st : static g : global c : const You get the picture
stpcasz : static pointer to a const array of NULL terminated string.
Comments
:
: [code]char *(*aszWords);
: [/code]
:
: or am I barking up the wrong tree altogether?
Well, if this is C, then that is correct, but the parentheses are unnecessary. The compiler is already parsing the declaration like that. Check the C FAQ (second link in my signature) for some different approaches to this problem.
If this is C++, then you would much rather use a std::vector.
What the heck is that identifier supposed to stand for? I understand the 'Words' part, but 'asz'? Are those for Asian words or something?
HTH,
Will
--
http://www.tuxedo.org/~esr/faqs/smart-questions.html
http://www.eskimo.com/~scs/C-faq/top.html
http://www.parashift.com/c++-faq-lite/
http://www.accu.org/
: :
: : [code]char *(*aszWords);
: : [/code]
: :
: : or am I barking up the wrong tree altogether?
:
: Well, if this is C, then that is correct, but the parentheses are unnecessary. The compiler is already parsing the declaration like that. Check the C FAQ (second link in my signature) for some different approaches to this problem.
:
: If this is C++, then you would much rather use a std::vector.
:
: What the heck is that identifier supposed to stand for? I understand the 'Words' part, but 'asz'? Are those for Asian words or something?
:
:
: HTH,
: Will
: --
: http://www.tuxedo.org/~esr/faqs/smart-questions.html
: http://www.eskimo.com/~scs/C-faq/top.html
: http://www.parashift.com/c++-faq-lite/
: http://www.accu.org/
:
:
:
Hello,
the "asz" is a naming convention....
a : array
sz : string zero ( NULL terminated )....
p : pointer
st : static
g : global
c : const
You get the picture
stpcasz : static pointer to a const array of NULL terminated string.
Pat