Question: I often see the following function declaration:

```
some_func(const unsigned char * const buffer)
{

}

```

Any idea why the const is repeated before the pointer name?

Thanks.

Answer: 
The first `const` says that the data pointed to is constant and may not be changed whereas the second `const` says that the pointer itself may not be changed:

```
char my_char = 'z';
const char* a = &my_char;
char* const b = &my_char;
const char* const c = &my_char;

a = &other_char; //fine
*a = 'c'; //error
b = &other_char; //error
*b = 'c'; //fine
c = &other_char; //error
*c = 'c'; //error

```
In a declaration like `const * const T`, the first `const` (before the `*`) means that what the pointer points *at* is `const` (i.e. it's a pointer to a `const T`). The `const` after the `*` means that the pointer *itself* is `const` (i.e. can't be modified to point at anything else).

You can read the declaration from the object being declared outward, so `const unsigned char * const buffer` is read as: "buffer is a const pointer to a const unsigned char" (this is why `const` should always being placed *after* what it modifies--with it before, you have to rearrange things to make the sentence--with it declared as `unsigned char const * const buffer`, translation to English is simple and straighforward (or perhaps "straightbackward", since you actually read from right to left in this case).