Firstly there are few issues in the shared code sample. Here
int* count; /* count is pointer i.e you need to make count to hold or point to some valid memory location */
count
is of int pointer type. And here
*count = 0; /* de-referencing uninitiated pointer */
you are trying to de-reference count
which has not valid memory. It causes segmentation fault. Before de-referencing you need to allocate memory. for e.g
count = malloc(sizeof(*count));
/* error handling of malloc return value */
*count = 0;
I am attempting to have a gobal counter the can can used by any
function in the program ?
You can do the same task without using pointer, try using static
if use having file scope. If possible avoid using global variable.