I'm working on a function that works as part of a larger program. My C pointer skills are a bit rusty and so I need some help here.
Notice: I've omitted a lot of the program because it is irrelevant and works correctly, all you need to know is that I import a header file that declares the struct ImportedStruct, also, I cannot change the function header, so I need to pass the ImportedStruct as a pointer and the function as a pointer.
I get the following error message in VS code: pointer to incomplete class type is not allowed.
Any ideas?
#include "name.h"
long int *functionName(struct ImportedStruct *structName, int *irrelevant){
int width = structName->width;
int height = structName->height;
// Remaining function ...
}
Header file:
struct ImportedStruct
{
int width, height;
};
ImportedStruct->structName.struct ImportedStructis a type, it has the keyword struct in front of it.