+ 2

why was my quiz declined?

so my quiz was: int a[] = {1,2,3,4,5}; int *ptr = a; cout<<3[ptr]; output : option A - error option B - 4 answer - option B - 4

25th Mar 2017, 1:41 AM
Puspal Ghosh
Puspal Ghosh - avatar
4 Answers
+ 11
The 3[ptr] notation is tricky and tricky questions are getting declined. I submitted 10 questions in Java and 6 of them are declined.
25th Mar 2017, 2:20 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 5
It is a good question. It may discover to a challenger the nature of C-language arrays. This could be useful for those who started programming from higher-level languages like Java. But "int *ptr = a;" is overloading. Just "cout << 3[a];" would be enough. Be laconic. And give more options. It is easy to guess only from 2 ones.
28th Mar 2017, 3:51 PM
Alx vSeti
Alx vSeti - avatar
+ 2
i see. :) i believed thought provoking questions were a good idea. my bad.
25th Mar 2017, 2:39 AM
Puspal Ghosh
Puspal Ghosh - avatar