How do i put a function inside another function? Im getting confused with the function definition. Plz help??
darkunknown 0
Newbie Poster
Recommended Answers
Jump to PostYou have to write two different functions, then in one of them you can call the other, like this
int foo() { return 5; } int main() { int x = foo(); }
Jump to Postfoo() doesn't just run -- when main() calls foo() the program's execution path will jump to the beginning of foo() and execute all the code in that function then return back to where it left off in main().
All 6 Replies
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
darkunknown 0
Newbie Poster
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
darkunknown 0
Newbie Poster
Lerner 582
Nearly a Posting Maven
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.