intialisation of charecter array
-
hi guys, If i create one character array of some size like, char* TempArray[10]; how do i intialise it???
-
hi guys, If i create one character array of some size like, char* TempArray[10]; how do i intialise it???
-
That is not a character array, it's an array of pointers. You need something like:
char foo[10] = "string";
// or
char* foo = "string";Note: Your signature is too big.
Use the best guess
nop i need array of charecter pointer?? not normal pointer above example that you have given is normal character string i need array of characters string. And i will change my sign;.
-
nop i need array of charecter pointer?? not normal pointer above example that you have given is normal character string i need array of characters string. And i will change my sign;.
Coder Block wrote:
nop i need array of charecter pointer??
That's not what your original question asked for.
char* foo[10] =
{
{ "string1" },
{ "string2" },
{ "string3" },
// ...
NULL // use to signify end of array if length is not known at compile time.
};And your signature is still too big; use the standard font size.
Use the best guess
-
hi guys, If i create one character array of some size like, char* TempArray[10]; how do i intialise it???
-
hi guys, If i create one character array of some size like, char* TempArray[10]; how do i intialise it???
Coder Block wrote:
char* TempArray[10];
you have initialize every array item individually like this char * temp[10]={"1","2"......};
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You