I have the following very simple program.
int modify(char * v){
v = "123" ;
return 0;
}
int main (int argc, char** argv){
char *test = new char[10];
modify(test);
std::cout << test;
return 0;
}
I know I can just print out "123", but I deliberately wrote it that way to learn about how pointers work. However, "123" is not printed. How should I correctly pass the pointer?