Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Constants
Point out the error in the program. #include
int main() { const int k=7; int *const q=&k; printf("%d", *q); return 0; }
Error: RValue required
Error: Lvalue required
Error: cannot convert from 'const int *' to 'int *const'
No error
Correct Answer:
No error
Explanation:
No error. This will produce 7 as output.
← Previous Question
Next Question→
More Questions from
Constants
Point out the error in the program. #include
#define MAX 128 int main() { char mybuf[] = "India"; char yourbuf[] = "CURIOUSTAB"; char *const ptr = mybuf; *ptr = 'a'; ptr = yourbuf; return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments