Is it possible for a function to return a string,an array of characters to the calling function?
i mean something like
char f1()
{
char www="nima";
return(www);
}
if not,please tell me how is this possible?
abcd_nima 0 Newbie Poster
Recommended Answers
Jump to Poststilllearning's third example could lead to problems, as you're allocating memory in the function, and may not remember to delete it later.
The fourth example doesn't need the address of operator, just return the string. It doesn't need to be created with the new operator, string objects will size …
All 3 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.