Welcome Guest | Sign in | Register
Inbuilt Functions - Discussion Page For Q.10698 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Inbuilt Functions > Questions and Answers

Q: What will be output of following program?
#include
#include
int main(){
char *ptr1 = NULL;
char *ptr2 = 0;
strcpy(ptr1," c");
strcpy(ptr2,"questions");
printf("\n%s %s",ptr1,ptr2);
return 0;
}  
A. c questions B. c (null)
C. (null) (null) D. Compilation error
E. None of above

Answer and Explanation

Answer:(null) (null)

Explanation:
We cannot assign any string constant in null pointer by strcpy function.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.