When we do a C program what are the reasons for getting segmentation fault. In other words highlight the situation under which one might get segmentation fault while doing C program
Printable View
When we do a C program what are the reasons for getting segmentation fault. In other words highlight the situation under which one might get segmentation fault while doing C program
when one fails to use the same number of closing braces as that of the opening braces.
when one fails to use the same number of closing braces as thet of the opening braces one may get segmentation problem.
When the rules to programming haven't been adhered, there are segmentation problems occurring. However, the compiler may pass successfully through the code, since there will not be any compilation errors....E.g: trying to print an integer as a string should generate a seg fault.
I don't think I understood ghosh answer. Not using same number of closing braces should actually lead you to a compilation error.