जॉइन Examsbookउत्तर :
Point out the error in the following program.
main()
{
char mybuf[] = "Zanzibar" ;
char yourbuf[] = " Zienckewiz";
char * const ptr = mybuf;
*ptr = 'a';
ptr = yourbuf;
}5
प्र: Point out the error in the following program. main() { char mybuf[] = "Zanzibar" ; char yourbuf[] = " Zienckewiz"; char * const ptr = mybuf; *ptr = 'a'; ptr = yourbuf; }
- उत्तर देखें
- Workspace
उत्तर :
व्याख्या :
ptr pointer is constant. In ptr = yourbuf the program is trying to modify it, hence an error.