Posts

Showing posts with the label warnings

Errors in C Language

Image
Errors are categorized  into two type: Warnings Errors 1. Warnings: Warnings, which indicate a potential problem, but still let your code compile. Warnings are sort of future bugs that will appear at runtime i.e. We might get undesired output even the inputs and the code are properly crafted. The modern compilers mostly generate the warnings and still compile your code till the executable file; the modern compilers automatically detect the problems and solve it on its own if it is small. Example: In this example below, we haven’t included the string library and still using string based predefined function in the program; the program will execute in this case but warning will come as “include <string.h> or provide a declaration for strlen ()”   To avoid warning:  You must include proper header files in the program. In above case, include string-based functions header file i.e. Write #include<string.h> before main (). 2. Errors: Types of er...