My C++ Quiz

The ultimate place to learn C++!

Question #75: Which of the following implementations of the reset function is best for initializing the array to all zero.

class foo{
public:
    foo(){
        reset();
    }
private:
    void reset(){

    // A // memset(x, 0, 50);
    // B // memset(x, 0, sizeof(x));
    // C // memset(x, 0, 50 * 4);
    // D // memset(x, 0, 50 * sizeof(x));
    }

    long x[50];
};