「C言語」エスケープシーケンス(特殊文字)を使うサンプル

説明
\n 改行
\r 行頭
\t タブ
\’ シングルクォーテーション
\" ダブルクォーテーション
\\ バックスラッシュ(\)
\? クエスチョンマーク
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#include<stdio.h>
int main(void) {
// 改行
printf("Abcde1233\n");
// タブ
printf("\t12345abcdde\n");
// バックスラッシュ
printf("\\123444\n");
// クエスチョンマーク
printf("\?1234456\n");
// シングルクォーテーション
printf("abb\'666");
// ダブルクォーテーション
printf("abb\"666");
return 0;
}
#include<stdio.h> int main(void) { // 改行 printf("Abcde1233\n"); // タブ printf("\t12345abcdde\n"); // バックスラッシュ printf("\\123444\n"); // クエスチョンマーク printf("\?1234456\n"); // シングルクォーテーション printf("abb\'666"); // ダブルクォーテーション printf("abb\"666"); return 0; }
#include<stdio.h>
 
int main(void) {
 
  // 改行
  printf("Abcde1233\n");
 
  // タブ
  printf("\t12345abcdde\n");
 // バックスラッシュ
  printf("\\123444\n");

 // クエスチョンマーク
  printf("\?1234456\n");

  // シングルクォーテーション
  printf("abb\'666");

  // ダブルクォーテーション
  printf("abb\"666");
 
  return 0;
}

 

C言語

Posted by arkgame