Nota berkaitan C++

Written on: March 19, 2021
Last updated: September 20, 2023
[ programming,cplusplus  ]

Comments

  1. Untuk single line comments :
#include <iostream>
//Contoh single line comments

int main()
{
    std::cout << "Hello World";
    //Contoh single line comments
    return 0;
    //Contoh single line comments
}
  1. Untuk multi line comments :
#include <iostream>

/* Contoh multi line comment
* Project A
* Made by B
* And bla bla bla
* comments end here */

int main()
{
    std::cout << "Hello World";
    return 0;
}

Statement

C++ mengandungi beberapa statement,antaranya ialah :

  1. Declaration statements
  2. Jump statements
  3. Expression statements
  4. Compound statements
  5. Selection Statements ( Conditional )
  6. Iteration statements ( Loops )
  7. Try blocks