Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fallo matriz
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#include <stdio.h> #include <stdlib.h> #include <time.h> int main ( ) { int **matriz ; int filas = 4 ; int columnas = 4 ; matriz = (int**)malloc(filas*sizeof(int*)); if (matriz == NULL){ printf("no se pudo reservar espacio en la memoria"); exit(1); } for (int i = 0 ; i < filas ; i++){ matriz = (int**)malloc(columnas*sizeof(int*)); } srand(time(NULL)); for(int i = 0 ; i < filas ; i++) for(int j = 0 ; j < columnas; j++){ matriz[i][j]= rand()%4; printf("%d%d ",matriz[i][j]); } printf("\n"); }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.13 sec, absolute running time: 0.16 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 0,55 sec
fork mode
|
history
|
discussion
Error(s):
Invalid memory reference (SIGSEGV)