isset ?

hello i need some kind of function that checks if the integer is already set or not.
in php this functions name is:' isset '
ive seen the isset in c++ codes too(maybe it was some other isset) but i dont know in which library i should look.
can someone tell me where i could find that function (if it exists)
or how to check if the int is set yet.
You simply can't do that. Just make sure to initialize the variable to a sensitive value when you create the integer.
Last edited on
ive been searching for it and ive found a solution for it. here small code for it.

1
2
3
4
5
6
7
bool isset(false);
int a;
if (isset==false) {
cin>>a;
isset=true;
}
I don't really see what you're trying to do. In c++, a variable is always "set". At least for primitive types. Granted it may be garbage if you havent initialized it, but thats the job of the programmer. Why create code to see if you, the programmer, gave this variable a value when you could just give the variable a value
the user had to input the int a once and after that he only had to add int b
so i had to know if a had already a value or not
Topic archived. No new replies allowed.