# 5.2.33 hdfql_subcursor_get_unsigned_tinyint

Part of: [5 Application Programming Interface](5-application-programming-interface.md) › [5.2 Functions](5-2-functions.md)

### Syntax

unsigned char \*hdfql_subcursor_get_unsigned_tinyint(const HDFQL_CURSOR \*_cursor_)

### Description

Get the current element of the subcursor in use as an [UNSIGNED TINYINT](6-1-2-unsigned-tinyint.md). In other words, the current element is interpreted as an “unsigned char” C data type and returned as a pointer to such type. If the result subset is empty or the subcursor is located before or after the first or last element of the result subset, the returned element is NULL.

### Parameter(s)

_cursor_ – pointer to a cursor to get the current element of the subcursor in use as an [UNSIGNED TINYINT.](6-1-2-unsigned-tinyint.md) If the pointer is NULL (in C), the current element of the subcursor of the cursor in use is returned instead. The equivalent of a NULL pointer in C++, Java, Python, C#, Fortran, R, and MATLAB HDFql wrappers is NULL, null, None, null, NULL(), NULL, and NaN, respectively. While in C _cursor_ is mandatory, in C++, Java, Python, C#, Fortran, R, and MATLAB it is optional (when not specified, the current element of the subcursor of the cursor in use is returned instead).

### Return

unsigned char \* – pointer to the current element of the subcursor. If there is no current element, the pointer will be NULL.

### Example(s)

```c
// create an HDF5 dataset named "my_dataset" of data type variable-length unsigned char of one dimension (size 3)
hdfql_execute("CREATE DATASET my_dataset AS UNSIGNED VARTINYINT(3)"); 

// insert (i.e. write) values into dataset "my_dataset" 
hdfql_execute("INSERT INTO my_dataset VALUES((5, 2), (8), (4, 3, 9))"); 

// select (i.e. read) data from dataset "my_dataset" and populate cursor in use with it  
hdfql_execute("SELECT FROM my_dataset"); 

// move the cursor in use to next position within the result set (i.e. first position) 
hdfql_cursor_next(NULL); 

// display current element of the cursor in use as an unsigned char (should be "Current element of cursor is 5")
printf("Current element of cursor is %u\n", *hdfql_cursor_get_unsigned_tinyint(NULL)); 

// move the subcursor in use to next position within the result subset (i.e. first position) 
hdfql_subcursor_next(NULL); 

// display current element of the subcursor in use as an unsigned char (should be "Current element of subcursor is 5")
printf("Current element of subcursor is %u\n", *hdfql_subcursor_get_unsigned_tinyint(NULL)); 

// move the subcursor in use to next position within the result subset (i.e. second position)
hdfql_subcursor_next(NULL); 

// display current element of the subcursor in use as an unsigned char (should be "Current element of subcursor is 2")
printf("Current element of subcursor is %u\n", *hdfql_subcursor_get_unsigned_tinyint(NULL));
```
