Question: I have set up a custom Password Reset policy in Azure AD B2C that allows the user to change their password while displaying custom branding elements depending on specific scenarios. This policy contains a step where the user verifies their Email Address by entering a verification code that is sent to their inbox. 

From this post in the Microsoft Azure Feedback Forums: [fully-customizable-verification-emails](https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/15334335-fully-customizable-verification-emails)

It seems it is not possible to fully customise verification emails.

However, is it possible to perform some basic customisation of the verification e-mail within a custom policy? (text sent in the "From" and "Title" sections of the email and modifications to the text sent in the body).

Answer: 
Whoah, there are errors everywhere here!!

If you want to store an array of single chars, just define it as:

```
char y[5];

```

Now, the next bit has a few issues:

```
y[1] == "A";
y[2] == "B";
y[3] == "C";
y[4] == "D";
y[4] == "F";

```

Apart from the obvious where you're using the comparison operator (`==`) instead of assignment (`=`), you were also trying to assign a string literal to a `char` array. You cannot do this outside of variable's definition. But I assert that you don't want to use strings. You also missed `y[0]` and doubled-up on `y[4]`.

Since I've already changed your array definition, we need character literals (single-quotes). Let's fix *all* of this:

```
y[0] == 'A';
y[1] == 'B';
y[2] == 'C';
y[3] == 'D';
y[4] == 'F';

```

But that's so much typing... Why not define it in one line, both saving your fingers and making your code more compact (and actually more readable):

```
char y[5] = { 'A', 'B', 'C', 'D', 'F' };

```

The next issue is you're returning `y[5]` for the 'F' score, which is not okay -- that is accessing outside your array: remember indexing is zero-based so the valid indices range from 0 to 4 inclusive. You need to check all your indices, because a few of them are wrong.

---

My final point is going to be a style-based thing, and you can take it or leave it. Instead of having this big if statement, why not put all your cutoff scores into an array... Rolling this into everything else I've mentioned so far, you'd end up with something like this:

```
char GradeFromPercentage(float score)
{
    const char grades[5] = { 'A', 'B', 'C', 'D', 'F' };
    const float scores[5] = { 90.f, 70.f, 50.f, 30.f, -FLT_MAX };
    for (int i = 0; i < 5; i++)
    {
        if (score >= scores[i]) return grades[i];
    }

    // It should not ordinarily be possible to reach here, but you should
    // return something anyway.  It's possible to get here if you supply
    // a score of `NaN`.  You may choose to return an invalid grade, or
    // 'F' or whatever.
    return '\0';
}

```
You're only getting the array from your 2D array! You have to do something like this:

```
if (...) {
    return y[0][1];
} else if (...) {
    return y[1][1];
}

...

```

Your `y` array is a 2D array. 2D arrays are arrays that hold arrays. `y[5][1]` will define a character array of length `5` with each cell in the array holding another character array of length `1`.

Since you are referencing elements in `y` at the first level only (e.g. `y[0]`), you will be getting the character array instead of just a character. To get the characters inside `y`, you will need to reference twice: one to get the array holding the character and another to get the character inside the array.

Alternatively, you can just use a 1D array which you can define with

```
char y[5];
y[0] = 'A';
...

```

or, as achicn3 [suggested](https://stackoverflow.com/a/53439679/1116098), with

```
char y[5] = {'A', ..., 'F'};

```