Skip to content · ⁨コンテンツへスキップ⁩
English

Text is an array of chars

  • C has no separate string type. A string is just an array of char.
  • char word[] = "hi"; actually stores 'h', 'i', and a hidden '\0' at the end.
  • You can read one character at a time with an index, exactly like any array.
日本語

文字列はchar配列である

  • Cには独立した文字列型はありません。文字列とは単なるcharの配列です。
  • char word[] = "hi";は実際には'h'、'i'、そして末尾に隠れた'\0'を格納しています。
  • インデックスを使って文字を1つずつ読み取ることができます。これはどの配列でも同じように動作します。

Handout · ⁨プリント⁩

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP