compile by vc2010, coding style of C++11?

[code]

include //for std::for_each, std::reverse and std::copy
include //for std::array
include //for std::cout, std::cin.get
include //for std::ostream_iterator
include

template
void reverseString(T &value)
{
std::for_each(value.begin(), value.end(),
[](std::string &fir)
{
std::reverse(fir.begin(), fir.end());
});
}

int main()
{
std::array<std::string, 3> value = {"one", "two", "three"};
reverseString(value);
std::copy(value.begin(), value.end(), std::ostream_iterator(std::cout,"\n"));
std::cin.get();

return 0;
}
[/code]

compile by vc2010, coding style of C++98?
[code]

include
include
include

//I don't know how to deduce the number of the element at compile time
//without passing a parameter "num", please tell me how to
//do it if you know, thanks
void reverseString(std::string value[], size_t num)
{
for(size_t i = 0; i != num; ++i)
std::reverse(value[i].begin(), value[i].end() );
}

int main()
{
std::string value[] = {"one", "two", "three"};
reverseString(value, sizeof(value)/ sizeof(*value) );
std::copy(value, value + 3, std::ostream_iterator(std::cout,"\n"));
std::cin.get();

return 0;
}
[/code]

the implementation of std::reverse are quite simple
I only post the one with random access iterator(a smart pointer which similar to pointer)

[code]
template
void Reverse(RandomItr begin, RandomItr end)
{
while(begin < end)
{
std::iter_swap(begin, --end);
++begin;
}
}
[/code]

looks like you need to read a file(like txt?)
If you want to read a file, you need std::ifstream or std::fstream
but I would suggest for std::ifstream.

[code]
struct student_info
{
size_t id;
std::string name;
size_t subject_num;
//you could consider another containers according to your need
std::map<std::string, size_t> subCode_and_marks;

private :
//insert the data according to the number of the subject_num
void insert_subCode_and_marks();
};
[/code]

There are a lot of the ways to solve this problem
I don't know is this what you want?
std::map could extend the sizes dynamically
if you want to save them as dynamic array
you could try
[code]
std::vector<std::pair<std::string, size_t> > subCode_and_marks;
[/code]

I hope this could help you

I solved it
[code]
child->addSibling(Node);
[/code]
sould be
[code]
addSibling(Node);
[/code]

Narue commented: Cheers for solving your problem *and* letting everyone know what it was. Good thread. +24