PLuNK Posted November 1, 2008 Share Posted November 1, 2008 Hello, I'm currently going through a book I purchased a while back regarding C++, And I'm currently stuck on trying to call other functions that don't hold or return a value. #include <iostream> void mouse2(void); void mouse3(void); using namespace std; int main() { cout << "Three blind mice\n"; void mouse2(void); void mouse3(void); cin.get(); cin.get(); return 0; } void mouse2(void) { cout << "Three blind mice\n"; } void mouse3(void) { cout << "See how they run\n" << "See how they run"; } Thanks I hope someone will be able to help me so I can move onto the next chapter (Can't wait!!) Quote Link to comment Share on other sites More sharing options...
Fourtyfreak Posted November 1, 2008 Share Posted November 1, 2008 Hello, I'm currently going through a book I purchased a while back regarding C++, And I'm currently stuck on trying to call other functions that don't hold or return a value. I'm a noob at C++ but try this... #include <iostream> void mouse2(void); void mouse3(void); using namespace std; int main() { cout << "Three blind mice\n"; mouse2(); mouse3(); cin.get(); cin.get(); return 0; } void mouse2(void) { cout << "Three blind mice\n"; } void mouse3(void) { cout << "See how they run\n" << "See how they run"; } Simply call the function using its name, ie, mouse2(). If you aren't passing any values to the function simply leave the parentheses empty. Hope this helps. FF Quote Link to comment Share on other sites More sharing options...
PLuNK Posted November 2, 2008 Author Share Posted November 2, 2008 Thank you so much. (But don't worry I'll have some more for you.. Heh) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.