I have a problem with this code:
it supposed to find the end of array (muzptr), to dynamicaly add another place to it and fill it.
Now muzptr is a dynamic array of a structure type named "music".
Can somebody tell me what's wrong with this code?
while (!(muzptr[e].makat==NULL)) e++;
muzptr=(music*) realloc(muzptr, 1*sizeof(music));
if(muzptr==NULL)
{
perror("Can not allocate memory!");
exit(1);
}
muzptr[e+1]=Muz;
thanx
This post has been edited by maugly: 25 June 2008 - 04:36 AM

New Topic/Question
Reply




MultiQuote



|