Expand|Select|Wrap|Line Numbers
- int main()
- {
- char* x = NULL;
- int i;
- i = atoi(x);
- printf("i = %d\n",i);
- return 0;
- }
when we pass NULL to atoi(or any functions like this) it is giving segmentation fault. My question is why they didnt check for NULL case( which should be given first priority) in such inbuilt implementations.