Lesson 18 of 23
Pointers: Address-களுடன் வேலைPointers: Working with Addresses
12 min 35 XP
ஒவ்வொரு variable-ம் memory-ல் ஒரு address-ல் இருக்கும். &x அந்த address-ஐத் தரும். Pointer என்பது address-ஐ சேமிக்கும் variable: int *p = &x;. *p அந்த address-ல் உள்ள மதிப்பு (dereference).
Every variable lives at an address in memory; &x gives that address. A pointer is a variable that stores an address: int *p = &x;. *p reads or writes the value at that address (dereferencing).
Example: edit me and press Run
Press Run to see the result here.NULL pointer-ஐ dereference செய்தால் (*q) program crash ஆகும் (segmentation fault). பயன்படுத்தும் முன் NULL-ஆ என்று சோதியுங்கள்.
Dereferencing a NULL pointer crashes the program (a segmentation fault). Check for NULL before using a pointer.