Jump to content

Need Support, C++ Application.


PLuNK
 Share

Recommended Posts

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!!)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Thank you so much.

(But don't worry I'll have some more for you.. Heh)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...