I tried to implement this:

mystruct *myArray = (mystruct*)malloc(howManyItems*sizeof(mystruct));

When I'm trying to manipulate an item of the array with

*myArray[index].structmember = somevalue


the compiler tells me

"illegal indirection"


What am I doing wrong? An example of how to delete an item at a certain index would be cool, too!