segmentation fault after running the following code:
int main(){
const char *string = "This is not reverse";
char *reverse;
char temp;
int length, i = 0;
length = strlen(string);
strcpy(reverse, string);
while(i < (length/2)){
temp = *(reverse+i); // this is the reason for segmentation fault..but why?
i++;
}
}
could someone please explain the reason for the same