#include <stdlib.h>
#include <conio.h>
#include <string.h>
int *elementocoluna(int *v, int m, int n, int auxiliar){
int i, j, aux, k,l=0, *aux2;
aux2=(int*)calloc(sizeof(int),m*n);
for(i=0; i<n; i++){
for(j=0; j<m; j++){
printf("digite a%d%d: ",j,i);
scanf("%d",&aux);
if(i==auxiliar){
aux2[l]=aux;
l++;
}
k=i*n+j;
v[k]=aux;
}
}
return aux2;
}
int main(){
int m,n,*v,*k,l=0,i,j,aux;
printf("digite a qntd de linha\n");
scanf("%d",&m);
printf("digite a qntd de coluna\n");
scanf("%d",&n);
v=(int*)calloc(sizeof(int),m*n);
printf("Qual coluna deseja os elementos: \n");
scanf("%d",&aux);
k = elementocoluna(v,m,n,aux);
for(i=0;i<m;i++){
printf(" %d", k[i]);
printf("\n");
}
system("pause");
return 0;
}
Coloque aqui o seu email