# Which is better?

This is a discussion on Which is better? within the C++ Programming forums, part of the General Programming Boards category; Two quick questions.. 1) Is it possible to put a blank space in a int array? I have zero's in ...

1. ## Which is better?

Two quick questions..

1) Is it possible to put a blank space in a int array? I have zero's in there presently but was wondering if I could put blank spaces in it like you can in a char array.

2) Which is better?

Code:
```// horizontal
if ( (x1 == 1) && (x2 == 1) && (x3 == 1) )
return 1;
else if ( (x1 == 2) && (x2 == 2) && (x3 == 2) )
return 2;

if ( (x4 == 1) && (x5 == 1) && (x6 == 1) )
return 1;
else if ( (x4 == 2) && (x5 == 2) && (x6 == 2) )
return 2;
...```
or

Code:
```// horizontal
if ( (x1 == 1) && (x2 == 1) && (x3 == 1) )
return 1;
else if ( (x1 == 2) && (x2 == 2) && (x3 == 2) )
return 2;
else if ( (x4 == 1) && (x5 == 1) && (x6 == 1) )
return 1;
else if ( (x4 == 2) && (x5 == 2) && (x6 == 2) )
return 2;
...```
There are quite a few more if statements. Thanks for your time

2. 1) You can put the numeric value of a black space, although I don't see how that'll be useful because you'll have some number, it's probably better just to leave it to zero.

2) I'd say the first one, because it groups together the related checks and there's a clear distinction between them.

3. I'd have to agree that the first one would be better.

4. Is it possible to put a blank space in a int array?
No. Every memory location in your computer contains some numerical value. ..."How many eggs are in the basket?" You can answer zero, but you can't answer "blank".

A blank space in a character array has a decimal value of 32 (decimal), which is the ASCII code for a space.