C Language Basics (3)-Common escape characters

Source: Internet
Author: User

1.

void Main () {    printf ("\ n"//\ GetChar is ignored     ();}

2. Print character A

void Main () {    printf ("\ ' a\ '"//  print character A     GetChar ();}

3. \f \v

void Main () {    printf ("hello \f Google \v"//  \f \v is a junk character     GetChar ();}

4. \ r

void Main () {    printf ("Hello Google \ r"//  \ r is to get the cursor back to the beginning      GetChar ();}

5. \

void Main () {    printf ("\" e:\\qq\\bin\\qqsclauncher.exe\ ""//  print path     System ("\" e:\\qq\\bin\\qqsclauncher.exe\ ""//  open QQ      GetChar ();}

6. \ n

void Main () {    printf ("\ n hahaha "//  newline     getchar ();}

7. \ t

void Main () {    printf ("Google");    printf ("\ t"//  \ t represents a tab-stop    printf ("  Google");    GetChar ();}

8. \b

void Main () {    printf ("Google");    printf ("\b"//  \b Represents a backspace     getchar ();}

9. \a

#include <stdio.h>#include<stdlib.h>#include<windows.h>voidMain () {//printf ("test result ... \ n");//\ n represents a newline character \a represents a sound.printf"\a"); Sleep ( +); printf ("\a"); Sleep ( +); printf ("\a"); Sleep ( +); printf ("\a"); Sleep ( +); printf ("\a"); Sleep ( +); printf ("\a"); Sleep ( +); System ("Pause");}

C Language Basics (3)-Common escape characters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.