Get Started
1337

Q: Point out the error, if any, in the following program. main() {     int ( *p )() = fun;     ( *P ) (); } fun () {     Printf ( "\nLoud and clear" ); }

  • उत्तर देखें
  • Workspace

Answer :
Explanation :

Here we are initalising the function pointer p to the address of the function fun(). But during this initialisation the function has not been defined. Hence an error. To eliminate this error add the prototype of the fun() before declaration of p, as shown below: extern int fun();    or simply  int fun();

सबसे विस्तृत एग्जाम तैयारी प्लेटफार्म

Examsbook Prep ऐप आज ही प्राप्त करें