title: C++ - Check if pointer is pointing to valid memory (Can't use NULL checks here)
body: <p>I am creating scripting language.
  When I allocate thing ,it's allocate the thing and returns the address 
  and then I do whatever with it and then delete it. I can't control the variables in it
  like creating struct in my lang (Struct with pointer and bool to check if pointer is pointing to valid data) and etc because it'll make my lang slower and bigger in the RAM.</p>
  
  <p>For example: (My scripting language is easily to understood. I doubt you'll not understand this ,but I'll put some comments in it anyway)</p>
  
  <pre><code>MyStruct = { //Function. For create object with it use 'new' before it.
      TestAliveVar=0
  }
  Func = { //I'll explain what exactly this function does every place it runs.
      if (!exists(arg0)) //C++: ???
          exit;
      arg0.TestAliveVar=1
      println "Still alive!";
  }
  var MyVar=new MyStruct(); //Returns address of the new object in the heap
                            //and runs on it the `MyStruct` function.
  Func(MyVar);              //Sets his 'TestAliveVar' to 1
                            //and prints 'Still Alive!' with new line
  delete(MyVar);            //C++: free(MyVar);
  Func(MyVar);              //Does nothing
  </code></pre>
  
  <p>The question is how to create the function <code>exists</code> you saw in this code.
  BTW I can run C++ codes in this lang.</p>