# HDF5 1.8.5 - writing data elements one-by-one

**URL:** <https://forum.hdfgroup.org/t/hdf5-1-8-5-writing-data-elements-one-by-one/1810>\
**Category:** Hdf-forum archives\
**Created:** [July 19, 2010, 11:32pm UTC](https://forum.hdfgroup.org/t/hdf5-1-8-5-writing-data-elements-one-by-one/1810 "2010-07-19T23:32:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Schoolov\_Mihail\_Y\_CI](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@Schoolov\_Mihail\_Y\_CI](https://forum.hdfgroup.org/u/Schoolov_Mihail_Y_CI)\
**Post date:** [July 19, 2010, 11:32pm UTC](https://forum.hdfgroup.org/t/hdf5-1-8-5-writing-data-elements-one-by-one/1810/1 "2010-07-19T23:32:08Z")

</div>

I'm trying to write data to a dataset consisting of a 1-by-4 array of  
integers, but I want to write the integers one-by-one, appending an  
integer to the existing dataset each time through the loop. I'm using a  
hyperslab to select where I am writing, and then writing the integer  
(four writes total). This simple example simulates the way I will  
(eventually) be writing more complex real-time data that is streaming  
in.

Everything I've read so far indicates that the following code should  
work. Am I missing an obvious step? Why is only the first element being  
written correctly?

Thanks in advance - I appreciate any feedback and am looking to learn

&nbsp;&nbsp;// Create file descriptor for HDF output file  
&nbsp;&nbsp;hid\_t file = H5Fcreate("output.h5", H5F\_ACC\_TRUNC, H5P\_DEFAULT,  
H5P\_DEFAULT);

&nbsp;&nbsp;hid\_t dataset, datatype, dataspace;

&nbsp;&nbsp;// Initial hyperslab selection will be the first element (0,0)  
&nbsp;&nbsp;hsize\_t start[] = {0,0};  
&nbsp;&nbsp;hsize\_t count[] = {1,1};

&nbsp;&nbsp;// Make the dataset dimensions 1-by-4  
&nbsp;&nbsp;hsize\_t dims[] = {1, 4};

&nbsp;&nbsp;// Create the file dataspace  
&nbsp;&nbsp;dataspace = H5Screate\_simple(2, dims, NULL);  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;// Create the dataset  
&nbsp;&nbsp;dataset = H5Dcreate(file, "/dset", H5T\_STD\_I32LE, dataspace,  
H5P\_DEFAULT, H5P\_DEFAULT, H5P\_DEFAULT);

&nbsp;&nbsp;// Create buffer  
&nbsp;&nbsp;int \*ii = new int;

&nbsp;&nbsp;for (int i = 0; i \< 4; i++) {  
&nbsp;&nbsp;&nbsp;&nbsp;// Set value of buffer (first time is 15, then 16, etc)  
&nbsp;&nbsp;&nbsp;&nbsp;\*ii = i+15;  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;// Select 1-by-1 hyperslab to write to, starting at the  
first element (0,0)  
&nbsp;&nbsp;&nbsp;&nbsp;start[1] = i;  
&nbsp;&nbsp;&nbsp;&nbsp;H5Sselect\_hyperslab(dataspace, H5S\_SELECT\_SET, start,  
NULL, count, NULL);  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;// Write data  
&nbsp;&nbsp;&nbsp;&nbsp;H5Dwrite(dataset, H5T\_STD\_I32LE, H5S\_ALL, dataspace,  
H5P\_DEFAULT, ii);  
&nbsp;&nbsp;}

&nbsp;&nbsp;// Clean up  
&nbsp;&nbsp;H5Dclose(dataset);  
&nbsp;&nbsp;H5Sclose(dataspace);  
&nbsp;&nbsp;H5Fclose(file);

&nbsp;&nbsp;// I expect this to create the following 1-by-4 dataset of  
integer elements:  
&nbsp;&nbsp;//  
&nbsp;&nbsp;// | 15 | 16 | 17 | 18 |  
&nbsp;&nbsp;//  
&nbsp;&nbsp;// Instead, it only seems to write to the first element:  
&nbsp;&nbsp;//  
&nbsp;&nbsp;// | 15 | -1219428236 | 0 | 17 |  
&nbsp;&nbsp;//  
&nbsp;&nbsp;// In fact, even if skip the first element, and initially set  
start to {0, 1}, it still won't  
&nbsp;&nbsp;// let me write to any of the other elements:  
&nbsp;&nbsp;//  
&nbsp;&nbsp;// | 0 | -1219428236 | 0 | 17 |  
&nbsp;&nbsp;//  
&nbsp;&nbsp;// What is going on? FYI: I mostly followed the code written in  
the HDF User Guide

> **···**
>
> from my mistakes.

---

<div class="post-metadata">

**Author:** ![Ethan\_Dreyfuss](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/278dde/32.png) [@Ethan\_Dreyfuss](https://forum.hdfgroup.org/u/Ethan_Dreyfuss)\
**Post date:** [July 20, 2010, 1:56am UTC](https://forum.hdfgroup.org/t/hdf5-1-8-5-writing-data-elements-one-by-one/1810/2 "2010-07-20T01:56:17Z")

</div>

I think your problem might be the H5S\_ALL in your H5DWrite. The docs say  
the following for specifying H5S\_ALL for memspace and a valid dataspace id  
for file space:

The file dataset's dataspace is used for the memory dataspace and the  
selection specified with file\_space\_id specifies the selection within it.  
The combination of the file dataset's dataspace and the selection from  
file\_space\_id is used for memory also.

Which means that you're selecting elements at an offset of more than one  
into your one element array ii.

Cheers,  
Ethan

> **···**
>
> On Mon, Jul 19, 2010 at 4:32 PM, Schoolov, Mihail Y CIV SPAWARSYSCEN-PACIFIC, 56540 \<mihail.schoolov@navy.mil\> wrote:
> 
> > I'm trying to write data to a dataset consisting of a 1-by-4 array of  
> > integers, but I want to write the integers one-by-one, appending an integer  
> > to the existing dataset each time through the loop. I'm using a hyperslab to  
> > select where I am writing, and then writing the integer (four writes total).  
> > This simple example simulates the way I will (eventually) be writing more  
> > complex real-time data that is streaming in.
> > 
> > Everything I've read so far indicates that the following code should work.  
> > Am I missing an obvious step? Why is only the first element being written  
> > correctly?
> > 
> > Thanks in advance - I appreciate any feedback and am looking to learn from  
> > my mistakes.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create file descriptor for HDF output file  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hid\_t file = H5Fcreate("output.h5", H5F\_ACC\_TRUNC, H5P\_DEFAULT,  
> > H5P\_DEFAULT);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hid\_t dataset, datatype, dataspace;
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Initial hyperslab selection will be the first element (0,0)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t start = {0,0};  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t count = {1,1};
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Make the dataset dimensions 1-by-4  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t dims = {1, 4};
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create the file dataspace  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataspace = H5Screate\_simple(2, dims, NULL);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create the dataset  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataset = H5Dcreate(file, "/dset", H5T\_STD\_I32LE, dataspace,  
> > H5P\_DEFAULT, H5P\_DEFAULT, H5P\_DEFAULT);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create buffer  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int \*ii = new int;
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i \< 4; i++) {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set value of buffer (first time is 15, then 16, etc)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*ii = i+15;
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Select 1-by-1 hyperslab to write to, starting at the  
> > first element (0,0)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start[1] = i;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Sselect\_hyperslab(dataspace, H5S\_SELECT\_SET, start,  
> > NULL, count, NULL);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Write data  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Dwrite(dataset, H5T\_STD\_I32LE, H5S\_ALL, dataspace,  
> > H5P\_DEFAULT, ii);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Clean up  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Dclose(dataset);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Sclose(dataspace);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Fclose(file);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// I expect this to create the following 1-by-4 dataset of integer  
> > elements:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// | 15 | 16 | 17 | 18 |  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Instead, it only seems to write to the first element:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// | 15 | -1219428236 | 0 | 17 |  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// In fact, even if skip the first element, and initially set  
> > start to {0, 1}, it still won't  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// let me write to any of the other elements:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// | 0 | -1219428236 | 0 | 17 |  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// What is going on? FYI: I mostly followed the code written in  
> > the HDF User Guide
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Hdf-forum is for HDF software users discussion.  
> > Hdf-forum@hdfgroup.org  
> > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)

---

<div class="post-metadata">

**Author:** ![Quincey\_Koziol](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/q/dbc845/32.png) [@Quincey\_Koziol](https://forum.hdfgroup.org/u/Quincey_Koziol)\
**Post date:** [July 20, 2010, 12:47pm UTC](https://forum.hdfgroup.org/t/hdf5-1-8-5-writing-data-elements-one-by-one/1810/3 "2010-07-20T12:47:26Z")

</div>

> I think your problem might be the H5S\_ALL in your H5DWrite.

&nbsp;&nbsp;Yes, I think that's part of the issue. I also think Mihail wants to use H5Dset\_extent() to make the dataset's dataspace larger on each pass through the loop.

&nbsp;&nbsp;Quincey

> **···**
>
> On Jul 19, 2010, at 8:56 PM, Ethan Dreyfuss wrote:
> 
> > The docs say the following for specifying H5S\_ALL for memspace and a valid dataspace id for file space:
> > 
> > The file dataset's dataspace is used for the memory dataspace and the selection specified with file\_space\_id specifies the selection within it. The combination of the file dataset's dataspace and the selection from file\_space\_id is used for memory also.
> > 
> > Which means that you're selecting elements at an offset of more than one into your one element array ii.
> > 
> > Cheers,  
> > Ethan
> > 
> > On Mon, Jul 19, 2010 at 4:32 PM, Schoolov, Mihail Y CIV SPAWARSYSCEN-PACIFIC, 56540 \<mihail.schoolov@navy.mil\> wrote:  
> > I'm trying to write data to a dataset consisting of a 1-by-4 array of integers, but I want to write the integers one-by-one, appending an integer to the existing dataset each time through the loop. I'm using a hyperslab to select where I am writing, and then writing the integer (four writes total). This simple example simulates the way I will (eventually) be writing more complex real-time data that is streaming in.
> > 
> > Everything I've read so far indicates that the following code should work. Am I missing an obvious step? Why is only the first element being written correctly?
> > 
> > Thanks in advance - I appreciate any feedback and am looking to learn from my mistakes.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create file descriptor for HDF output file  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hid\_t file = H5Fcreate("output.h5", H5F\_ACC\_TRUNC, H5P\_DEFAULT, H5P\_DEFAULT);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hid\_t dataset, datatype, dataspace;
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Initial hyperslab selection will be the first element (0,0)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t start = {0,0};  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t count = {1,1};
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Make the dataset dimensions 1-by-4  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t dims = {1, 4};
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create the file dataspace  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataspace = H5Screate\_simple(2, dims, NULL);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create the dataset  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataset = H5Dcreate(file, "/dset", H5T\_STD\_I32LE, dataspace, H5P\_DEFAULT, H5P\_DEFAULT, H5P\_DEFAULT);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create buffer  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int \*ii = new int;
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i \< 4; i++) {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set value of buffer (first time is 15, then 16, etc)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*ii = i+15;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Select 1-by-1 hyperslab to write to, starting at the first element (0,0)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start[1] = i;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Sselect\_hyperslab(dataspace, H5S\_SELECT\_SET, start, NULL, count, NULL);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Write data  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Dwrite(dataset, H5T\_STD\_I32LE, H5S\_ALL, dataspace, H5P\_DEFAULT, ii);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Clean up  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Dclose(dataset);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Sclose(dataspace);  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5Fclose(file);
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// I expect this to create the following 1-by-4 dataset of integer elements:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// | 15 | 16 | 17 | 18 |  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Instead, it only seems to write to the first element:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// | 15 | -1219428236 | 0 | 17 |  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// In fact, even if skip the first element, and initially set start to {0, 1}, it still won't  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// let me write to any of the other elements:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// | 0 | -1219428236 | 0 | 17 |  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// What is going on? FYI: I mostly followed the code written in the HDF User Guide
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Hdf-forum is for HDF software users discussion.  
> > Hdf-forum@hdfgroup.org  
> > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Hdf-forum is for HDF software users discussion.  
> > Hdf-forum@hdfgroup.org  
> > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)
