Saturday, 12 October 2013

C++ course (third section 2)

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
-Error in program called bug
-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

Unknown

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment

 
biz.