What's the preferred way to pass a string to and from a function?
sneekula 969 Nearly a Posting Maven
Recommended Answers
Jump to PostPassing back the original pointer is sometimes also used so that the function can be a nested function call. Example:
const char* foo(char *ptr) { ... <snip> return ptr; } int main() { printf("%s\n", foo("How now brown cow.")); }
All 3 Replies
Salem 5,265 Posting Sage
plumsauce 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
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.