hi all..
i'm a bit confused how the pointer works..
Code:
std::string n;
//is this right??
// i'll create an empty array of string with x elements in it
char * str = new char [x]
// if i want to fill in
strcpy(str,n.c_str)
let say n= "HELLO"
after i copy it does this mean *str= "HELLO" or str = "HELLO" ????
this also mean str[0] = 'H' ???
and another thing on double pointer
Code:
//create new space
char** word = new char* [num of str];
so what is the best way for me to copy *str into **word so the ouput for **word = "HELLO" ?? what i mean here is the word[0] = "HELLO" ...
thanks in advance