title: HDF5 hid_t obj_id? Difference between HDF5 API and other hdf5-functions
body: <p>I'm trying to work with HDF5-Files (in C++). Therefor I work with the Examples from the HDF5-API: <a href="http://www.hdfgroup.org/HDF5/doc/cpplus_RM/namespaceH5.html" rel="nofollow">http://www.hdfgroup.org/HDF5/doc/cpplus_RM/namespaceH5.html</a></p>
  
  <p>There are a lot of useful examples but I have trouble when I try to "mix" it with other examples from the Tutorial: <a href="http://www.hdfgroup.org/HDF5/Tutor/" rel="nofollow">http://www.hdfgroup.org/HDF5/Tutor/</a></p>
  
  <p>For example I try to find out if an attribute exists in an HDF5-File. Therefor I open an existing file and then I get problems with the function: H5Aexists</p>
  
  <pre><code>#ifdef OLD_HEADER_FILENAME
  #include &lt;iostream.h&gt;
  #else
  #include &lt;iostream&gt;
  #endif
  #include &lt;string&gt;
  #ifndef H5_NO_NAMESPACE
  #ifndef H5_NO_STD
  using std::cout;
  using std::endl;
  #endif // H5_NO_STD
  #endif
  #include "H5Cpp.h"
  #ifndef H5_NO_NAMESPACE
  using namespace H5;
  #endif
  
  const H5std_string FILE_NAME ("file.h5");
  const H5std_string DATASET_NAME ("/dataset1/data1/data");
  
  
  int main (void)
  {
  
       Exception::dontPrint();
  
       /*
      * Open the specified file and the specified dataset in the file.
      */
      H5File file( FILE_NAME, H5F_ACC_RDONLY );
      DataSet dataset = file.openDataSet( DATASET_NAME );
  
  
      const char* where;
  
      //H5Aexists(file,where);
  
      return 0;
  
  }
  </code></pre>
  
  <p>H5exists expects an integer hid_t with the object id. When I use examples from the Tutorial, then I get an object id by using:</p>
  
  <pre><code>hid_t file_id;
  
  file_id = H5File( FILE_NAME_dBBSC, H5F_ACC_RDONLY );
  </code></pre>
  
  <p>therefore they always include <code>hdf5.h</code> not <code>H5Cpp.h</code>.</p>
  
  <p>But where here do I get my "obj_id" from my code?</p>
  
  <p>In general, I don't get the difference between H5Cpp.h and hdf5.h. Or between the HDF5-API and the other functions?!</p>
  
  <p>Thanks for your help!</p>
  
  <p>edit:</p>
  
  <p>I guess this is how I get an file id?!</p>
  
  <p>hid_t file_id = file.getId();</p>
  
  <p>but how can I get the Id of an attribute? I can't find how to open an Attribute (not a DataSet) so that I can read the contents?!</p>