write function to reverse char array ... without using second
array

Answer Posted / kiran

{
char temp;
for(i,j=strlen(str)-1;i<j;i++,j--)
{
temp = str[i];
str[i] = str[j];
str[j] = temp;
}
return str;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

797


What is the difference between variable declaration and variable definition in c?

557


What is main return c?

511


What is a spanning Tree?

944


What is a void pointer in c?

602






How would you use the functions fseek(), freed(), fwrite() and ftell()?

697


write a proram to reverse the string using switch case?

2459


Why is structure important for a child?

601


Can you tell me how to check whether a linked list is circular?

757


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1066


what is the significance of static storage class specifier?

1653


Who invented bcpl language?

698


What are the advantages of union?

622


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

655


How many header files are in c?

547