Hi guys! This is my 2nd exercise regarding this topic. Myself and most of my classmates are completely lost. I've tried to do the function part first, does it look correct or could I get any tips on what's wrong?
All kinds of tips are extremely appreciated. I'm reading my C book like a lunatic to find something that will help me.
So the code I've been writing this far is:
#include <stdio.h>
#include <stdlib.h>
int** expand(int n, int* v); //prototype
int main()
{
int n;
int **Matrix;
while(scanf("%d", &n)==1)
{
}
}
int** expand(int n, int* v)
{
int **Matrix = malloc(sizeof(int*) * *v);
if (Matrix)
memcpy(Matrix, n, sizeof(int*) * *v);
return Matrix;
}