PDA

نسخه کامل مشاهده نسخه کامل : رشته یا آرایه ای از کارکتر ها؟



iranch
01-10-2013, 17:40
دروود
چه فرقی داره ما از رشته استفاده کنیم یا آرایه از کارکتر ها ؟
یکی از اینها که رشته قابلیت تغیر نداره و immutable هست .و ارایه ای از کاکتر ها تغیر پذیره.

rahnema1
02-10-2013, 08:43
Most programming languages have support for text strings as first class types. However, most CPUs have no
special support for strings, so all this entails quite a bit of work by the compiler. C generally closely reflects
the hardware capabilities, and so C doesn’t have much in the way special support for text strings in the base
language. Thus strings in C are implemented using arrays and pointers