Data
Pokémon data
Pokédex
Moves
Type chart
Abilities
Items
Evolution chains
Pokémon locations
Sprite gallery
Quick links
National Pokédex
Pokémon list with stats
Legends: Arceus Pokédex
Scarlet & Violet Pokédex
Mechanics
Game mechanics
Breeding & egg groups
Move Tutors
Dual type chart
Effort Values (EVs)
Natures
IVs/Personality
Useful tools
Moveset searcher
Type coverage checker
Text list generator
Games
Pokémon games
Legends Z-A
Scarlet & Violet
Pokémon GO
Legends: Arceus
Brilliant Diamond & Shining Pearl
Sword & Shield
Let's Go Pikachu & Let's Go Eevee
Ultra Sun & Ultra Moon
Sun & Moon
Omega Ruby & Alpha Sapphire
X & Y
Black 2 & White 2
Black & White
HeartGold & SoulSilver
Platinum
Diamond & Pearl
Emerald
FireRed & LeafGreen
Ruby & Sapphire
Crystal
Gold & Silver
Yellow
Red & Blue
Spin-off games
Other
Community/Other
Pokémon Q&A
Pokémon Rate My Team
Chat Room
Meta (Suggestion Box)
Other pages
Pokémon News
Maps/Puzzles
Pokémon name origins
About/Contact us
Search
Meta-PokéBase Q&A
PokéBase
Rate My Team
Login
Register
All Activity
Questions
Unanswered
Tags
Users
Ask a Question
Rules
Chat
User stall_fest
Wall
Recent activity
All questions
All answers
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
Page:
prev
1
...
5
6
7
8
9
10
11
12
13
...
98
next
Useful Posts
PokéBase starter guide
How to change your username
How to add a user avatar
Why was my post hidden?
The points system
Flags vs Downvotes
Report users
PokemonDb Tournaments
PokemonDb Discord server
PokemonDb Showdown server
Help out
Outdated/unresolved questions
Report minor site errors
Name Origins corrections
Location guide corrections
...