Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Ejemplo De Matrices En C

DZone's Guide to

Ejemplo De Matrices En C

·
Free Resource
Se crea un matrix dinamica en c, y luego se muestra, el tamano de muestra siempre es de 10x10


#include 
  
   
#include 
   
    

void mostrar(int **a){
	 int i,j;
	for (i=0;i<10;i++){
		for (j=0;j<10;j++){
		printf("%i",a[i][j]);
		}
		printf("\n");
	}	
	 
};

int main(){
	int i,j,**a;
	a=(int**)malloc(10*sizeof(int*));

	for (i=0;i<10;i++){
		a[i]=(int*)malloc(10*sizeof(int));
		for (j=0;j<10;j++){
			a[i][j]=i;	
		}
	}	
	mostrar(a);
	getchar();
	return 0;
}


   
  
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}