hola estoy intentando hacer una matriz y inicializarla despues de su creacion de un modo directo osea de golpe mirar os pongo codigo para que veais a lo que me refiero pero meda error y no se como solucionarlo para no tener que hacerlo dato por dato
int tablero[16][16];
int mapa = 1;
main()
{
if (mapa == 1){
tablero = {{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12}};};
else
{
tablero = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};};
return 0;
}
si lo ago asi error pero si lo inicializo igual pero ala hora de crearlo
funciona no entiendo por que
int tablero[16][16] = {{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12},
{10,12,12,12,12,12,12,12,12,12,12,12}};
asi ok todo funciona bien podeis ayudarme.
un saludo
Kaltorak.