elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Temas
Páginas: [1]
1  Programación / Programación C/C++ / Matriz aleatoria en c en: 14 Mayo 2019, 20:56 pm
Buenas tengo un problema para imprimir una matriz aleatoria en c en ubuntu y es que al imprimir directamente me salen como unos cuadrados muy raros si me podeis ayudar se agradece ;D

CODIGO:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUMFILAS 6
#define NUMCOLUMNAS 6

void inicializa(int m[NUMFILAS][NUMCOLUMNAS]);

int main(int argc, char*argv[]){
   int m[NUMFILAS][NUMCOLUMNAS];
   srand(time(NULL));
   inicializa(m);
   return 0;
}

void inicializa(int m[NUMFILAS][NUMCOLUMNAS]){
   int i,j;
   for(i=0;i<NUMFILAS;i++){
      for(j=0;j<NUMCOLUMNAS;j++){
         m[j]=rand()%10+1;
         printf("%ls\t",&m [j]);
         
}
         printf("\n");   
}

         
   
}

OBSERVACIÓN: Antes de los [j] deberia salir un i entre corchetes tambien pero no sale no se porque
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines