08-28-2011, 05:34 PM
How to Deal With Errors in C Programming ? 2011-12
A single error can result in error messages for subsequent correct statements. This generally happens with statements that refer to something that is supposed to be defined by a statement containing an error. If a statement that defines something has an error, then what was supposed to be defined won’t be.
Example program showing an error:
#include<stdio.h>
int main(void)
{
printf("If at first you don\’t succeed, try, try, try again!")
return 0;
}
If you now try to compile this program, you’ll see an error message shown below:
Syntax error : missing ‘;’ before ‘}’
HELLO.C – 1 error(s), 0 warning(s)
The compiler is able to determine precisely the error and its location. There should be a semicolon at the end of that printf() line. It’s so easy to forget a comma or a bracket, or to just press the wrong key. Even experienced programmers make exactly the same mistakes—even after years of practice. However, with experience you will make fewer mistakes and be able to locate and fix the errors without much difficulty.
A single error can result in error messages for subsequent correct statements. This generally happens with statements that refer to something that is supposed to be defined by a statement containing an error. If a statement that defines something has an error, then what was supposed to be defined won’t be.
Example program showing an error:
#include<stdio.h>
int main(void)
{
printf("If at first you don\’t succeed, try, try, try again!")
return 0;
}
If you now try to compile this program, you’ll see an error message shown below:
Syntax error : missing ‘;’ before ‘}’
HELLO.C – 1 error(s), 0 warning(s)
The compiler is able to determine precisely the error and its location. There should be a semicolon at the end of that printf() line. It’s so easy to forget a comma or a bracket, or to just press the wrong key. Even experienced programmers make exactly the same mistakes—even after years of practice. However, with experience you will make fewer mistakes and be able to locate and fix the errors without much difficulty.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
