ok well ... this is what i got so far. The idea is to lett the user put in the amount of rows and colums for the memory game. but i cant get it to work. basicly i suck at programming, but i gotta find how to make this work. also the table (memory field) has to get filled with black boxes, and when clicked on (using conio.h) it should show whats under it (the memory sign).
btw rij (rijen) means row/rows
and kolom/kolommen means colums
so NOW can anyone help me out?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
char k=128;
printf("Het Asci teken: %c",k);
*/
int main(void)
{
char**rijen;
char**kolommen;
char k=128;
int rij, kolom, i, j;
printf("Geef het aantal rijen: ");
scanf("%d%*c", &rij);
rijen = calloc( sizeof(char*), rij);
printf("Geef het aantal kolommen: ");
scanf("%d%*c", &kolom);
kolommen = calloc( sizeof(char*), kolom);
for (i=0;i<rij;i++)
{
strcpy(rijen[i], k);
}
for (j=0;j<kolom;j++)
{
strcpy(kolommen[j], k);
}
for (i=0;i<rij;i++)
{
printf("%c",rijen[i]);
free(rijen[i]);
}
for (j=0;j<kolom;j++)
{
printf("%c",kolommen[i]);
free(kolommen[j]);
}
return 0;
}