[SOLUCIONADO] Duda con Matrices

Iniciado por [Z]tuX, Abril 07, 2012, 12:26:27 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Abril 07, 2012, 12:26:27 AM Ultima modificación: Marzo 12, 2014, 10:13:21 PM por Expermicid
Hola que tal...
Tengo una duda con este codigo:
Código: Cpp

#include <stdio.h>

int main(){
    int matriz[1][1];
    matriz[0][0]=1;
    matriz[0][1]=2;
    matriz[1][0]=3;
    matriz[1][1]=4;

    printf("%d",matriz[0][1]);
    return 0;

}


Se supone que tendria que mostrarme en pantalla el valor de 2, pero no es asi, me muestra que es igual 3, y no se porque pasa esto
Espero alguien pueda ayudarme
Salud[OS]

Abril 09, 2012, 12:52:39 AM #1 Ultima modificación: Marzo 12, 2014, 10:13:33 PM por Expermicid
Solucion
Código: c

#include <stdio.h>

int main(){
    int matriz[1][2];
    matriz[0][0]=1;
    matriz[0][1]=2;
    matriz[1][0]=3;
    matriz[1][1]=4;

    printf("%d",matriz[0][1]);
    return 0;

}


saludos..
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
In my mind where before there was order, today there is only chaØs!