Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPA-21-02 Topic 8 Question 41 Discussion

Actual exam question for C++ Institute's CPA-21-02 exam
Question #: 41
Topic #: 8
[All CPA-21-02 Questions]

Point out an error in the program.

#include

using namespace std;

int main()

{

const int x=1;

int const *y=&x;

cout<<*y;

return 0;

}

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Eladia
7 days ago
This question is making my head spin! I'm just going to guess and hope for the best. Let's go with... B) Error: unknown pointer conversion. Why not, right?
upvoted 0 times
...
Noelia
8 days ago
Wait, is this a trick question? Surely there has to be a mistake somewhere. I'll play it safe and say D) Compilation error.
upvoted 0 times
...
Yoko
9 days ago
Hold on, didn't we learn about this in class? I think the correct answer is B) Error: unknown pointer conversion. I'll go with that.
upvoted 0 times
Bea
2 days ago
I think the correct answer is B) Error: unknown pointer conversion.
upvoted 0 times
...
...
Margurite
11 days ago
I believe there is a compilation error in the program.
upvoted 0 times
...
Glen
26 days ago
Hmm, I'm not sure about this one. Isn't there something about const pointers? I'll guess C) cannot convert from 'const int *' to 'int *const'.
upvoted 0 times
Therese
10 days ago
User2: C) cannot convert from 'const int *' to 'int *const'
upvoted 0 times
...
Johana
17 days ago
User1: B) Error: unknown pointer conversion
upvoted 0 times
...
...
Xenia
1 months ago
D) Compilation error
upvoted 0 times
...
Margo
1 months ago
This code looks fine to me. The output will be '1', so I'll go with A) No error.
upvoted 0 times
Noel
21 days ago
User 1
upvoted 0 times
...
Lajuana
29 days ago
User 2
upvoted 0 times
...
Twana
1 months ago
User 1
upvoted 0 times
...
...
Kayleigh
2 months ago
I think the error is in the pointer conversion.
upvoted 0 times
...
Gianna
2 months ago
B) Error: unknown pointer conversion
upvoted 0 times
...

Save Cancel