الانتقال إلى المحتوى الرئيسي
eLearner.app
C++ MEMORY LABYRINTH

متاهة الذاكرة C++: المؤشرات والمراجع

إدارة تخصيص الذاكرة في C++، وحل ثلاثة ألغاز عملية في حساب المؤشر، والمؤشرات الذكية (std::unique_ptr)، والتمرير المرجعي.

MEMORY CONSTRAINT

قم بتنفيذ وظيفة "get_value_at_index" لإرجاع القيمة إلى فهرس الصفيف المطلوب باستخدام حساب المؤشر (استخدم بناء جملة إلغاء المرجع * والإضافة +). استخدام الأقواس المربعة [] ممنوع.

Memory Monitor
SECURE
Array Memory Offset:
+0B
10
+4B
20
+8B
30
+12B
40
+16B
50
ptr = arr*(ptr + 3) -> 40
✓ Memory safe, zero leaks, and zero copy overheadgcc v13.2.0

Stuck?

Learn the fundamental concepts in the C++ course to solve this challenge.

Static C++ Compiler

Write valid C++ code to satisfy allocation and ownership constraints.

جارٍ تحميل المحرر…