GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Given a class: MyClass And the following function: void Test…

Given a class: MyClass And the following function: void TestFunction(MyClass mc){ /*irrelevant code omitted*/ } Which member functions of MyClass will be called as a result of, but not necessarily on, the following line? Mark all that apply. TestFunction(someExistingMyClassObject);

Read Details

Given the following: class GameObject{ GameObject *target_;p…

Given the following: class GameObject{ GameObject *target_;public: const GameObject *GetTarget() const { return target_; } void SetTarget(const GameObject *t) { target_ = t; }}; Do you need to write the Big Three for GameObject?

Read Details

All pointers must point to dynamically allocated memory.

All pointers must point to dynamically allocated memory.

Read Details

How long does dynamically allocated memory last?

How long does dynamically allocated memory last?

Read Details

Given a class: MyClass And the following function: void Test…

Given a class: MyClass And the following function: void TestFunction(MyClass mc){ /*irrelevant code omitted*/ } Which member functions of MyClass will be called as a result of, but not necessarily on, the following line? Mark all that apply. TestFunction(someExistingMyClassObject);

Read Details

Gamma decay occurs when an excited nuclear state emits a pos…

Gamma decay occurs when an excited nuclear state emits a positron.

Read Details

What will the following code print out? void Function(int *p…

What will the following code print out? void Function(int *ptr){ *ptr = 11;}// In main…int values[] = { 4, 10, 6, 12, 8, 14 };int *p = &values[4];Function(p);for (int i = 2; i < 5; i++) cout

Read Details

ἕξω

ἕξω

Read Details

Given that an integer requires 4 bytes of memory, how much m…

Given that an integer requires 4 bytes of memory, how much memory is leaked by the following code (i.e. how many bytes)? int x = 0;int* y = new int[4];y = new int[3];delete[] y;y = new int[2];y = &x;

Read Details

Given the following class: class Foo{ int* bar; int foobar;p…

Given the following class: class Foo{ int* bar; int foobar;public: Foo(); ~Foo(); Foo(const Foo& original); Foo& operator=(const Foo& original);};Foo::Foo(){ foobar = 10; bar = new int[foobar];}Foo::~Foo(){ delete[] bar;}Foo::Foo(const Foo& original){ foobar = original.foobar; bar = original.bar;}Foo& Foo::operator=(const Foo& original){ *this = original;} Indicate whether each member of the “Big Three” is implemented correctly or not.

Read Details

Posts pagination

Newer posts 1 … 54,363 54,364 54,365 54,366 54,367 … 72,641 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top