Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. What will be the output?

    main()

    {

    char *p;

    p = "Hello";

    printf("%cn",*&*p);

    }

  2. A.

     Hello

    B.

     H

    C.

     Some address will be printed

    D.

     None of these.

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    * is a dereference operator & is a reference operator. They can be applied any number of times provided it is meaningful. Here p points to the first character in the string "Hello". *p dereferences it and so its value is H. Again & references it to an address and * dereferences it to the value H.


Be The First To Comment