zenniz
Junior Member level 3
- Joined
- Mar 25, 2013
- Messages
- 29
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Singapore
- Activity points
- 1,497
I'm trying to write simplified program
char SPACE has no fix byte
Variable A is a random value of 1 and 0
If A = 0, SPACE = 'XX'
If A = 1, SPACE = 'Y'
I'm trying to assign one SPACE char variable for each loop int i value
For example if
int 0, A = 1
int 1, A = 1
int 2, A = 0
int 3, A = 1
The end result will be "Y Y XX Y"
char SPACE has no fix byte
Variable A is a random value of 1 and 0
If A = 0, SPACE = 'XX'
If A = 1, SPACE = 'Y'
I'm trying to assign one SPACE char variable for each loop int i value
Code:
char *space ????
for(int i; i = 0; i++)
{
if(A == 1) {
???? = "XX"
} else {
???? = "Y"
}
}
printf("%s %s %s %s", ???????);
For example if
int 0, A = 1
int 1, A = 1
int 2, A = 0
int 3, A = 1
The end result will be "Y Y XX Y"
Last edited: