Question: I work with code that takes user-defined strings and prints them on a [VGA](https://en.wikipedia.org/wiki/Video_Graphics_Array) monitor, using predefined font arrays saved in a header file. But there are lines of code that I couldn't understand in other source codes, like these ones: 

```
uint8_t *rowoftext ; 
char *text[20] = {"string1","string2",.......,"srting20"};

```

What does this line really do?

```
rowoftext = (uint8_t *)text[textrow++];

```

How do I equalize an array of uint8\_t pointers to another pointer?
Do I understand it well, or what does this line do?

Answer: 
The bit `(uint8_t *)` is called a *cast*. It converts one type to another, in this case one pointer type to another pointer type. This is very dangerous if the pointed-to objects aren't compatible, but in this case they are.
Explanation in gory detail:

```
uint8_t *rowoftext;
char *text[20] = {"string1","string2",.......,"srting20"};

```

* uint8\_t is (probably) defined somewhere in a header file as:

typdef unsigned char uint8\_t;
* rowoftext is declared as a pointer, and defined with file scope as a pointer to uint8\_t, and assigned a default value of NULL.
* text is declared as an array of pointers to signed char, and defined as an array of 20\*sizeof(char\*), either 80 on a 32bit system, or 160 on a 64bit system.

The line of code,

```
rowoftext = (uint8_t *)text[textrow++];

```

* determines the value of the variable textrow (probably defined as int or unsigned int
* increments the value stored in the textrow variable
* locates the textrow'th element of the array text and dereferences that address, equivalent to,

\*(text+textrow)
* this expression has type (char\*), as text[] is of type (char\*)
* coerces the pointer to char (char\*) to another pointer type (uint8\_t), which is unsigned
* the unchanged pointer is stored in the variable rowoftext

were you to look at rowoftext prior to this statement, it stored NULL or a previously assigned pointer value. Now the variable rowoftext contains the pointer (address) which was stored in text[textrow].

The post-increment of textrow incremented the value of the variable textrow, but used the value of textrow prior to the increment. This idiom is quite common in C and C++.

There is a difference between the following two declarations,

```
uint8_t *rowoftext;
uint8_t rowoftext[ integer_expression ];

```

The first declares rowoftext to be a variable that holds a pointer, which can be assigned the base address of an array, and then used to traverse an array, by incrementing the pointer.
The second declares a constant pointer to an array of uint8\_t elements. Both examples declare variables (sic) which can be used with the [] operator to address an array of uint8\_t, like so,

```
rowoftext[ integer ]

```

which is equivalent to

```
*(rowoftext + integer)

```