搜尋此網誌

2025年10月27日星期一

something basic

"Hello, World!\n"; → A string literal. The \n is an escape sequence that inserts a newline after printing.

#include <iostream>
using namespace std;   // brings all names from std into scope

int main() {
    cout << "Hello" << endl;       // works because of 'using namespace std;'
    std::cout << "World" << std::endl; // also works, fully qualified
    return 0;
}

沒有留言:

發佈留言