Returning an array of characters to a function

int main(char* pInput)
{
userInput();
char getInput[] = *pInput;
braceCheck(getInput);
}//end main

char userInput()
{
char checkInput[80];
cout<<"Input Anything: ";
cin>>checkInput;
if((checkInput[0]=='e')&&(checkInput[1]=='x')&&(checkInput[2]=='i')&&(checkInput[3]=='t')){
exit (0); //terminates the program
}//end if
else{
char ptrInput = checkInput;
return (*ptrInput);
}//end else
}//end userInput function

---------------------------------------
I have a problem returning an array of characters using pointer to main. What is the proper way of doing this? Do I pass a pointer or the array of characters? thanks
You can only return dynamic arrays from the function as pointer
You need to perform a google search on this topic. You should not be attempting to return arrays from a function. There are many, many threads that discuss this topic that include the correct, alternative solutions.
Topic archived. No new replies allowed.