Resource Management

1

Which is used to solve the memory management problem in c++?

A. Smart pointers
B. arrays
C. stack
D. none of the mentioned

2

What are the operators available in dynamic memory allocation?

A. new
B. delete
C. compare
D. both a & b

3

What is meant by garbage collection?

A. Form of manual memory management
B. Form of automatic memory management
C. Used to replace the variables
D. None of the mentioned

4

What is the output of this program?

 
1.
    #include 
2.
    #include
3.
    using namespace std;
4.
    int main()
5.
    {
6.
        try
7.
        {
8.
            char *p;
9.
            strcpy(p, "How r u");
10.
        }
11.
        catch(const exception& er)
12.
        {
13.
        }
14.
    }
A. How r u
B. segmentation fault
C. error
D. runtime error

5

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    int funcstatic(int)
4.
    {
5.
        int sum = 0;
6.
        sum = sum + 10;
7.
        return sum;
8.
    }
9.
    int main(void)
10.
    {
11.
        int r = 5, s;
12.
        s = funcstatic(r);
13.
        cout << s << endl;
14.
        return 0;
15.
    }
A. 10
B. 15
C. error
D. none of the mentioned