Just started to learn C language.
I have a pointer array int *parr and I need to fill it with random numbers and then do some other things with it.
But I even don’t understand how to fill it with random numbers. I tried something like this, but it hangs the program:
for(i=0 ; i<R ; i++)
{
for(j=0 ; j<C; j++)
{
*(parr+i*C+j)=rand() % 10;
printf("%d",*(parr+i*C+j));
}
printf("\n");
}
The way you initialize it, you probably have to
mallocmemory like this: