Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualParadigm Shifter

Posted 02 February 2014 - 12:05 PM

My program has SFML so I am not going to post that code but here is simple version of what I mean

#include <iostream>

using namespace std;

void function()
{
    cout << "Hello world!" << endl;
}

int main()
{
    return 0;
}

The program will say Hello World

but I want it to only run when i call the function later on

How do I stop that?

 

That's how you prevent it anyway.


#1Paradigm Shifter

Posted 02 February 2014 - 12:04 PM

My program has SFML so I am not going to post that code but here is simple version of what I mean

#include <iostream>

void function()
{
cout << "Hello world!" << endl;
}

using namespace std;

int main()
{

    return 0;
}

The program will say Hello World

but I want it to only run when i call the function later on

How do I stop that?

 

That's how you prevent it anyway.


PARTNERS