Escape characters and file.gcount

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;
}


Possible output:
Please, enter a word: simplify
9 characters read: simplify

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值