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

Answer Posted / sunitha

/* function to reverse a charactor array */

void rev_array(char str[])
{
char c;
char *p;
p=str;
while(*p)
{
if(*p!='\0')
{
c=p;
}
p++;
}
printf("reverse array is %s\n",c);
}

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 types of inheritance in c ++?

580


What is spaghetti programming?

668


Explain the bubble sort algorithm.

641


What does void main () mean?

731


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

5199






What is strcpy() function?

654


Difference between malloc() and calloc() function?

653


What are the disadvantages of a shell structure?

687


How do you define structure?

564


Add Two Numbers Without Using the Addition Operator

353


What is calloc()?

627


Is null always defined as 0(zero)?

614


Is flag a keyword in c?

677


Explain high-order bytes.

674


Explain void pointer?

589