Define the board space for a four-dimensional Tic Tac Toe board?
Answer:- tic tcs toe is a very simple two player game. So only two players can play at a time. This game is also known as Noughts and Crosses game. In this game we have a board consisting of a 3*3 grid.
Game rule:-
Winning condition:-
Whoever places three respective marks(X or O) horizontally vertically or diagonally will be the winner.
How do you pass a structure or an array to a function?
Answer:- It can be done in below 3 ways:-
If I declare a varibale as follows: int x; please describe how that variable is represent in memory.
Answer:- To represent variable ,we have to follow:-
Example to represent variable"int x" in memory:-
#include <stdio.h>
typedef unsigned char *byte_pointer; //create byte pointer using char*
void disp_bytes(byte_pointer ptr, int len)
{ //this will take byte pointer, and print memory content
int i;
for (i = 0; i < len; i++)
printf(" %.2x," ptr[i]);
printf("\n");
}
void disp_int(int x)
{
disp_bytes((byte_pointer) &x, sizeof(int));
}
main() {
int i = 5;
disp_int(i);
}
Get Answers For Free
Most questions answered within 1 hours.