Skip to content · ⁨דלג לתוכן⁩

Strings: char arrays and the null terminator · ⁨מחרוזות: מערכות character והסיום null terminator⁩

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.
עברית

טקסט הוא מערך של מקודדי ASCII

  • ל-C אין סוג מחרוזת נפרד. מחרוזת היא פשוט מערך של char.
  • char word[] = "hi"; למעשה מאחסן 'h', 'i', וגם מוסתר '\0' בסוף.
  • ניתן לקרוא אותיות בודדות באמצעות אינדקס, בדיוק כמו בכל מערך אחר.

Handout · ⁨חומר עזר⁩

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP