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
const char *fun(); int main() { *fun() = 'A'; return 0; } const char *fun() { return "Hello"; }
Error: RValue required
Error: Lvalue required
Error: fun() returns a pointer const character which cannot be modified
No error
Correct Answer:
Error: fun() returns a pointer const character which cannot be modified
← 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; }
Point out the error in the program. #include
int main() { const int x; x=128; printf("%d\n", x); return 0; }
Point out the error in the program. #include
int main() { const int k=7; int *const q=&k; printf("%d", *q); return 0; }
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