Can the C preprocessor directive #define accept parameters?
Which function is used to position back from the end of file object?
Which of the following gets called when an object is being created?
If you want to store dissimilar data types together, which data structure would you use?
Which of the following is not possible with a static array in C?
Where is the abstract class used?
What is meant by garbage collection?
What will be the output of the following c program?
#include <stdio.h>
int main()
{
int i = (1, 2, 3);
printf("%d", i);
return 0;
}
Which of the following is correct?
#include <iostream>
using namespace std;
class Circle {
double radius;
public:
Circle(double r) : radius(r) { }
double area() {return radius*radius*3.14159265;}
};
class Cylinder {
Circle base;
double height;
public:
Cylinder(double r, double h) : base (r), height(h) {}
double volume() {return base.area() * height;}
};
int main () {
Cylinder foo (10,20);
cout << "foo's volume: " << foo.volume() << '\n';
return 0;
}