C Programming - Const - Discussion
Discussion Forum : Const - Point Out Errors (Q.No. 4)
4.
Point out the error in the program.
#include<stdio.h>
const char *fun();
int main()
{
char *ptr = fun();
return 0;
}
const char *fun()
{
return "Hello";
}
Discussion:
21 comments Page 3 of 3.
Arj said:
1 decade ago
Pointer to a const char can be stored in a regular pointer to a char?
Please explain.
Please explain.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers