Horje
how to return char* from function in c++ Code Example
how to return char* from function in c++
//Function declaration
char* testfunc()
{
    char* str = malloc(10 * sizeof(char));
    return str;
}

//Calling the function
foo = testfunc();
// Do something with your foo
free(foo);		//It is required to free() memory to avoid memory lead




Cpp

Related
shuffle elements c++ Code Example shuffle elements c++ Code Example
default access specifier in c++ Code Example default access specifier in c++ Code Example
c++ check if char is number Code Example c++ check if char is number Code Example
c++ random number 0 to 1 Code Example c++ random number 0 to 1 Code Example
c++ isalphanum Code Example c++ isalphanum Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9