how to pass char* value by creating new?
here function definition is
ConvertNumberToString(double source, char *targetString)
{
}
wil u pleas tell me how to pass (char* targetstring) value in main() bymeans of creating memory by 'new' method?
Also explain Different types pass reference methods in c++?
well you know the type you want to return, char *, so put that in front of the name of the function.
To allocate a char array, you use
new char [dim_size] in C++ and
malloc(sizeof(char)*dim_size) in C. Note that the sizeof(char) is a little redundent, but is used exemplify how you would allocate for any array. Also note that in C, you do not have to cast to a char* when assigning it to a char*. malloc() returns a void * and a void * in C can be assigned to any pointer type and vice-versa.
Enjoy.
Adrian