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
How do I determine whether a character is numeric, alphabetic, and so on?
What is difference between Structure and Unions?
How do I send escape sequences to control a terminal or other device?
Is main is a keyword in c?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What does return 1 means in c?
What is const keyword in c?
How many keywords are there in c?
Where static variables are stored in c?
What is define c?
How to explain the final year project as a fresher please answer with sample project
What is the use of typedef in structure in c?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?