CPA 무료 덤프문제 온라인 액세스
| 시험코드: | CPA |
| 시험이름: | C++ Certified Associate Programmer |
| 인증사: | C++ Institute |
| 무료 덤프 문항수: | 220 |
| 업로드 날짜: | 2026-01-08 |
Point out an error in the program.
#include <iostream>
using namespace std;
int main()
{
const int x=1;
int const *y=&x;
cout<<*y;
return 0;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
#include <cstdarg>
using namespace std;
int mult(int f, int s, int t);
int main()
{
cout << mult(1,2,3);
return 0;
}
int mult(int f, int s, int t) { int mult_res; mult_res = f*s*t; return mult_res; }
What happens when you attempt to compile and run the following code?
#include <iostream> #include <string>
using namespace std;
class A {
protected:
int y;
public:
int x, z;
A() : x(1), y(2), z(0) {}
A(int a, int b) : x(a), y(b) { z = x * y;}
void Print() { cout << z; }
};
class B : public A {
public:
int y;
B() : A() {}
B(int a, int b) : A(a,b) {}
void Print() { cout << z; }
};
int main () {
A b(2,5);
b.Print();
return 0;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class A {
public:
int x;
A() { x=0;}
};
class B : protected A {
public:
int y;
using A::x;
B(int y) {this->y = y;}
void Print() { cout << x << y; }
};
int main () {
B b(5);
b.Print();
return 0;
}