Skip to content · ⁨الانتقال إلى المحتوى⁩

Strings: char arrays and the null terminator · ⁨النصوص: مصفوفات الأحرف والمُ终结 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.
العربية

النص مصفوفة من أحرف

  • C ليس لديها نوع سلكي منفصل. النص هو مجرد مصفوفة من char.
  • char word[] = "hi"; تخزن فعليًا 'h'، 'i'، ونهاية مخفية '\0' في النهاية.
  • يمكنك قراءة حرف واحد في كل مرة باستخدام فهرس، تمامًا مثل أي مصفوفة.

Handout · ⁨ورقة عمل⁩

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP