No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Why the following printf of the buffer in the readWav() causes segmentation fault just after printing the first row to the screen? Are there any issues with the use of pointer in printf("%d\t %f\n", i, *buffer[i]);? #include <stdio.h> #include "sndfile.h" int readWav(const char *const fname, long *numFrames, int *sRate, float … |
|
int subroutine (char *input, float *buffer) { *buffer = malloc(...) buffer is calculated from input } or flot subroutine (char *input) { *output = malloc(...) buffer is calculated from input return(buffer); } int main(int argc, char *argv[]) { float *data; subroutine(argv[] ...) ... free(data) } 1) which subroutine is recommended? … |