1. Predict the output or error(s) of the following c code

Thursday, September 1st, 2011
1
2
3
4
5
void main()
{
	int  const * p=5;
	printf("%d",++(*p));
}

Click here to view the answer

Avatar Image

Author Name :
Peter Vegas

Total : 1 Comment


One Response to “1. Predict the output or error(s) of the following c code”

  1. Rasmi Ranjan Nayak says:

    void main()
    {
    int const x = 5;
    int* p;
    p = &x;
    ++*p;

    printf(“%d \n”,x);
    printf(“%d”,*p);
    }

    op:- 5, 6 Why? Think!!!

Leave a Reply

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup