Ruby/Łańcuchy znakowe: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Linia 46:
</pre>
 
Konkatenacja łańcuchów jest bardziej kłopotliwa w C z powodu konieczności bezpośredniego zarządzania pamięcią:
Concatenating strings is much more awkward in C because of the need for explicit memory management:
 
<pre>
char *s = malloc(strlen(s1)+strlen(s2)+1);
strcpy(s, s1);
Linia 53 ⟶ 54:
/* ... */
free(s);
</pre>
 
But using ruby, we do not have to consider the space occupied by a string. We are free from all memory management.