Meta-PokéBase Q&A

Wall for stall_fest (page 5)

xD
May 20, 2019 by Syl ™
It depends on the compiler and version of C++ you are using. I don't think it is a big deal if return 1 doesn't work, but assert (in compilers that have it) should definitely be problematic if dis-functional. Don't sweat it, and work on the things you need to do for now. :P
May 20, 2019 by Staka~
what is your wall
May 15, 2019 by Syl ™
It could be your compiler. You might want to check it's documentation. Also, the code required you to enter 0 as the variable null to have the return statement activate. Where are you running this code? Is your compiler a C, C++, or C# compiler? (C++ can still run in C compilers, but some things may not operate the same or at all) :P

From your comment on my wall, I can't entirely tell what you meant, but did the program output/require you to input anything? :P

If your program did output something you might want to see if assert works. Assert does almost the same thing, here is the same program but with assert:

#include <iostream>
#include <cassert>

using namespace std;

int main()
{
    int null;
    int i;

    cin >> null;

    assert(null!=0);

    i=null/null;

    while (i<=3)
    {
        cout "Trololololololololololol/n";

        i++;
    }
    return 0;
}

Assert evaluates whatever statement is its parameter and if it evaluates to false, it aborts running the program and displays an "assertion failed" message. :P
May 11, 2019 by Staka~
I probably should've put an example or two in my intelligence bombshells. :P

You know what if and while loops are, right? If not, this will only make 50% sense:
Lets say I have the following program:

#include <iostream>

using namespace std;

int main()
{
    int null;
    int i;

    cin >> null;

    if (null==0)
        return 1;

    i=null/null;

    while (i<=3)
    {
        cout "Trololololololololololol/n";

        i++;
    }
    return 0;
}

Alright, in this main function, null is equal to 0, and divides by itself. This would put the program into a fail-state where all numeric operations result in 0. this is particularly bad for this program as its while loop becomes infinite during a fail-state. This could do some harm  if it doesn't get stopped or prevented by some way, which is why the if statement checks if null is 0, and if it is, returns 1 to end the program early and display an error message. :P

I believe your program had always generated the same result because you caused a fail-state, making whatever number the return statement had in front of it become a 0. :P
May 10, 2019 by Staka~
Chickens are love. chickens are life
May 9, 2019 by Chickenboy2004
https://www.youtube.com/watch?v=MMEuHdyexuw

Now we know that humanity still has a chance
May 5, 2019 by stall_fest
;D
May 4, 2019 by Azelfeo
So you are 7 hours before me. And np.
May 4, 2019 by Syl ™
You're welcome!
May 1, 2019 by Azelfeo