It was just an example.
kelton5020
Posts
-
Perhaps I should write an article -
Perhaps I should write an articleYeah you could create pointers for doing nulls, but it would probubly make more sense to have some sort of default convention.
int MyInt = 0;
if(MyInt == 0)//equivalent to nullor if you need to use 0
int MyInt = -1;
if(MyInt == -1)//nullor if you need the entire integer
intMyInt = 0;
bool isIntNull = true;
//do work here
if(isIntNull)//int null, reguardless of the ints valueOR(it's pretty damn basic, and I just threw it together in notepad so it may not compile, but the idea would work)
template
class Nullable{
bool isNull;
theType Value;
public:
Nullable(){
isNull = true;
}
bool IsNull(){
return isNull;
}
theType GetValue(){
return Value;
}
void SetValue(theType val){
isNull = false;
Value = val;
}
}; -
Perhaps I should write an articleYeah, but a pointer isn't any specific type, it's a reference to a location in memory.
-
Perhaps I should write an articleAh ok. In natural C++ though, ints,bytes,chars,and bools aren't nullable as far as I've ever known.
-
Perhaps I should write an articleIf you're rewriting in c++ with the CLR you have Nullable types in which any object can be null(This is how most ORMs deal with ints and bools etc).
-
Rant - I hate GITWell if you really have, you wouldn't be complaining about not knowing/understanding the terminology :p
-
Rant - I hate GITThis just shows that your problem isn't really with git, it's with you lack of knowledge of it. I'd imagine you're kind of a green horn to the technology, and you haven't quite figured out how all of these things actually benefit you, if you take a moment to learn them.