Recent content by vineeshvs

  1. V

    Passing a 2d array to a function in C

    #include <stdio.h> #include<stdlib.h> int **matrix_mul(int **m1,int **m,int a,int b,int c,int d); main() { int i,j,r1,r2,c1,c2,**p,**q; printf("Enter the number of rows and columns of first matrix :\t"); scanf("%d%d",&r1,&c1); printf("Enter the number of rows and columns of second matrix...
  2. V

    Passing a 2d array to a function in C

    i am doing coding in emacs. does it have a debugger??
  3. V

    Passing a 2d array to a function in C

    ok. then should i completely avoid x_transpose in main program and use only transpose instead?? then to which location should i store the pointer returned from function?? and for displaying the transpose can i use transpose[i][j] in the place of x_transpose[i][j] ?
  4. V

    Passing a 2d array to a function in C

    is there any alternative for wavread (in matlab) in c. i want to get the samples, sampling frequency and bits per sample?
  5. V

    Passing a 2d array to a function in C

    Reuse of memory inside a function #include<stdio.h> #include<stdlib.h> int **transpose(int **x,int m,int n); main() { int nrows=2,ncolumns=2,i,j,k=0; //memory allocation for array x int **array; array = malloc(nrows * sizeof(int *)); if(array == NULL)...
  6. V

    Passing a 2d array to a function in C

    thanks..it works. if i am allocating memory for x inside a function where should i use free(x), at the end of function or at the end of main program? if i don't use that, will it reduce memory much for ordinary programs (i have 4GB RAM)??
  7. V

    Passing a 2d array to a function in C

    #include<stdio.h> #include<stdlib.h> void function(int **x); main() { int nrows=2,ncolumns=2,i,j; //memory allocation for x int **x=malloc(nrows*sizeof(int*)); if(x==NULL) { printf("out of memory\n"); return 0; } for(i=0;i<nrows;i++) {...
Back
Top