The following C Code gives a segmentation fault:
#include <stdio.h> #include <stdint.h> int main(){ uint32_t *a; uint32_t idx=1233245613; a[idx]=1233; return 0; }
How can I use uint32_t as index of an array in C? Or how can I use array like structure which can get uint32_t and 12 digit numbers as an index?
I’d appreciate any kind of help.
Also you are trying to index pretty far in the array. You may not have enough memory available for this so be sure to check for NULL.