String copy logic in one line.
Answers were Sorted based on User's Feedback
Answer / jitendra
void cpy_user(char *s, char *t)
{
while ((*s++ = *t++) != '\0');
}
| Is This Answer Correct ? | 7 Yes | 7 No |
Answer / anurag
SORRY !!!
The last posted Ans. is for reverse of the string in one
line...by mistake it has been posted in this.
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / anurag
int i=0,len=strlen(str);
int j=len/2;len--;
while(i<j)
{
*(str+i)^=*(str+len)^=*(str+i)^=*(str+len);
len--;i++;
}
| Is This Answer Correct ? | 4 Yes | 7 No |
Answer / vijay
strpy(n1,n2)
here copy of string n2 in string n1
| Is This Answer Correct ? | 12 Yes | 24 No |
hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
write a c program to Reverse a given string using string function and also without string function
Cau u say the output....?
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
What is the main difference between STRUCTURE and UNION?
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }