main()
{
char * strA;
char * strB = I am OK;
memcpy( strA, strB, 6);
}
a. Runtime error.
b. I am OK
c. Compile error
d. I am O
Answers were Sorted based on User's Feedback
Answer / chandra
Answer is (c)compile error
compiler cannot initialize the string with out "". Hence any
compiler throws an error
If the string is with in "", then answer will be(a) Runtime
error.
since the string strA is used with out being initialized
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / prashant
if quotes are inserted ans will be -->
d) I am O
| Is This Answer Correct ? | 0 Yes | 3 No |
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
main() { 41printf("%p",main); }8
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com
how to delete an element in an array
write a origram swaoing valu without 3rd variable
Derive expression for converting RGB color parameters to HSV values
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }