ENع
الدرس 12 · Classes

Classes: objects and their lifetime

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A class is a blueprint for a type of your own: it bundles data with the functions that work on it, and it guards that data. Follow a small class, Tally, as main makes two objects from it: watch the constructor fill each object's memory, a member function change it, private keep outside code away, and the destructor run by itself when each object's scope ends, newest first. That fixed timing is the idea behind RAII.

11 دقيقة10 خطوات5 أسئلةIntermediate
شكل 12 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.