Escape characters and file.gcount

    xiaoxiao2021-12-14  23

    Escape characters

    All Escape Character have its importance in C++.

    I am sending u some common Escape characters. \a = alarm or alert \b = it is used for backspace. \t = it is used for tab(long space) \n = it is used for new line. \f = it is used for form feed. \r = it is used for return to the start of the same line. \\ = it is used to print one back slash. \" = it is used to print the inverted commas. All these escape characters will be used in double commas. I think just reading them is not sufficient. you should make practice of all these urself atleast once than all will be clear.

    Thanks

    About gcount:

    Example

    1 2 3 4 5 6 7 8 9 10 11 12 // cin.gcount example #include <iostream> // std::cin, std::cout int main () { char str[20]; std::cout << "Please, enter a word: "; std::cin.getline(str,20); std::cout << std::cin.gcount() << " characters read: " << str << '\n'; return 0; } Edit & Run Possible output: Please, enter a word: simplify 9 characters read: simplify

    转载请注明原文地址: https://ju.6miu.com/read-970593.html

    最新回复(0)