Monday, August 2, 2024

String / Character Array MCQ 1 : String Assigned to Character Pointer in C Programming Language





String / Character Array MCQ 1 : String Assigned to Character Pointer

Predict the Output of the Following Program ?
#include<stdio.h>
void main()
{
char *str="Pritesh";
printf("%s",str);
}
Options :
  1. Error : Declaration not Allowed
  2. Pritesh
  3. Illegal Pointer Initialization
  4. None Of these
Output :

Switch to String MCQ Home : Click Here

How and Why ?
  1. String Can be Initialized to Character Pointer
  2. Here Base Address of the String is Stored in Pointer Field
  3. For More Details : Click Here [String Initialization Techniques ]

Tags / Keywords : |

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates