binary tree : readPreoder

hello !
I have problem with readPreoder in binary tree
I have strings
{“cau”, “truc”, “du”, “”, “”, “lieu”, “va”, “”, “”, “”, “giai”, “”, “thuat”, “”, “”}
my teacher want us read string to array .. help me :D
i need a code ! :(
p/s I speak E.L very bad ..:)
you want to convert a string object into a character array?

the string class actually has a method called c_str() which gives back a character array representation of the string.

For example:

1
2
3
4
5
char array[20]; // empty character array
string myString = "hello world"; // string

// copy myString into character array.
strncpy(array[20], myString.c_str(), 20);
Thanks : but i want read strings to array with " readPreoder " in binaryTree :
ps: PreOder in Binary Tree :
help me ;)
Topic archived. No new replies allowed.