Question: I am preparing for an upcoming exam when I came across this:

> 
> 
> ```
> char a = 'a';
> char b = 'b';
> int ai[] = { 1, 2 };
> int i = 0;
> 
> ```
> 
> Assume that word size is 32 bits, that an int is 32 bits and that memory allocations are made in the reverse order to the declarations starting at address location 68.
> 
> 
> Draw a diagram that shows the effect of executing the following lines of code.
> 
> 
> 
> ```
> for (i = 0; i < 8; i++)
>     *(&a – i) = 'z';
> 
> ```
> 
> 

It might sound weird, but I am a newbie to C and it is the first time I've seen multiplication of a for loop. Explanation to this for loop and the multiplication applied to it would be appreciated.

Answer: 
Simply store directly the suit characters into your files `Cards.txt` using UTF-8 as character encoding instead of the corresponding unicode character format that is only understood by java such that when it is read from your file it is read as the `String` "`\u2660`" not as the corresponding unicode character.

Its content would then be something like:

```
♠2,2
...

```

---

Another way could be to use [`StringEscapeUtils.unescapeJava(String input)`](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#unescapeJava-java.lang.String-) to unescape your unicode character.

The code change would then be:

```
cards.add(new Card(StringEscapeUtils.unescapeJava(temp[0]), Integer.parseInt(temp[1])));

```
You'll have to save your file with `UTF-8` encoding and then read the file using the same encoding.

> 
> ♥,1 
> 
> 
> ♥,2 
> 
> 
> ♥,3
> 
> 
> 

Here is the code snippet:

```
BufferedReader buff = new BufferedReader(new InputStreamReader(
        new FileInputStream("Cards.txt"), "UTF-8"));

String input = null;
while (null != (input = buff.readLine())) {
    System.out.println(input);
    String[] temp = input.split(",");
    cards.add(new Card(temp[0], Integer.parseInt(temp[1])));
}

buff.close();

```

Also, you need to make sure that your console is enabled to support `UTF-8`. Look at [this](https://stackoverflow.com/a/18733665/2004685) answer to read more about it.