- #1
matiasmorant
- 39
- 0
the following code
#include<stdio.h>
#include<stdlib.h>
int
main (int argc, char *argv[])
{
int* a;
*a=1;
return 0;
}
compiles ok, but throws "Segmentation fault (core dumped)" at runtime
why is that?
i'm working with gcc in ubuntu. I have been able to compile and run many c programs without any difficulties
#include<stdio.h>
#include<stdlib.h>
int
main (int argc, char *argv[])
{
int* a;
*a=1;
return 0;
}
compiles ok, but throws "Segmentation fault (core dumped)" at runtime
why is that?
i'm working with gcc in ubuntu. I have been able to compile and run many c programs without any difficulties