1. First acquaintance with C++

  • 1, C++ is case sensitive, that is, it distinguishes between uppercase and lowercase characters.
  • C++ can use printf(), scanf(), and all other standard C input tools and output functions, only the regular stdio.h header file needs to be included.
  • The main() function can return an integer value to the function that calls it, and does not get any information from the function that calls it. In C++, main() is equivalent to main(void)
  • The input and output functions cin and cout functions are in the header file <iostream >. In the new style of C++, there is no extension .h after the header file. Such header files can include the namespace.
    If you use iostream instead of iostream.h, you should use namespace compilation instructions: using namespace std;classes, functions, and variables are the standard components of the C++ compiler, and they are now placed in the namespace std. This means: the cout function defined in iostream is actually: std::cout; endl is actually: std::endl;
    therefore, there can be:std::cout << "Hello, world.";
#include <iostream>
int main(

Guess you like

Origin blog.csdn.net/Shao_yihao/article/details/115280959