need help with char and ints in an array
below is a bit of a program that i am writing but at
the moment im having a problem with the array
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char start_board(char array[16]);
int main (void)
{
char board[16];
int countdown = 5;
printf ("welcome to the block puzzle game\nyou must rearrange the numbers in to asending order\n\n");
start_board(board[16]);
}
char start_board(char array[16])
{
int index = 0;
char board[16] = {'1','2','3','4','5','6','8','12','9','10','7','X','13','14','11','15'};
for(index = 0;index<=15;index++)
{
if (index ==4||index ==8|| index ==12)
{
printf("\n");
}
printf ("%c ", board[index]);
}
return board[16];
}
How can i get the output to print the two digit numbers in the array and still shox the X when it pops up
also i want to be able to scanf a integer and check if it is in the array although the array is in characters how would i do this