Lesson 16 of 23
Strings: Character Arrays
11 min 30 XP
C-ல் string என்பது '\0' (null character) உடன் முடியும் char array. "Hi" உண்மையில் 3 bytes: 'H', 'i', '\0'. <string.h>-ல் strlen, strcpy, strcat, strcmp போன்ற functions உள்ளன.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.Space உள்ள முழு வரியைப் படிக்க fgets பயன்படுத்துங்கள். அது வரி முடிவில் உள்ள \n-ஐயும் சேர்க்கும்; strcspn மூலம் நீக்கலாம்.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.strings-ஐ == மூலம் ஒப்பிட முடியாது (அது addresses-ஐ ஒப்பிடும்). strcmp(a, b) == 0 என்றால் சமம்.