C++ course (third section 2)
third section(writing your first C++ program 2)
#include <iostream> <------ this is the header
using namespace std; <------ location of header files
void main( ) <------primary function
{ <------marks beginning of function body
cout << “This is C++!”; <----statement that prints a string which is: This is C++!
} <----- marks end of function body
Debugging
Diagnosed by C++ compiler
Must fix before compiler will translate code
Difficult to find
Execution is complete but output is incorrect
Programmer checks for reasonable and correct output
third section(writing your first C++ program 2)
#include <iostream> <------ this is the header
using namespace std; <------ location of header files
void main( ) <------primary function
{ <------marks beginning of function body
cout << “This is C++!”; <----statement that prints a string which is: This is C++!
} <----- marks end of function body
-Error in program called bug
-Process of looking for and correcting bugs
-Three types of errors:
–Syntax
–Run-time
–Logic
-Process of looking for and correcting bugs
-Three types of errors:
–Syntax
–Run-time
–Logic
1)Syntax Errors
Mistakes by violating “grammar” rules Diagnosed by C++ compiler
Must fix before compiler will translate code
2)Run-Time Errors
Violation of rules during execution of program
Computer displays message during execution and execution is terminated
Error message may help locating error
3)Logic Errors
Computer does not recognize Difficult to find
Execution is complete but output is incorrect
Programmer checks for reasonable and correct output
0 comments:
Post a Comment