how to reverse string "Hello World" by using pointers only.
Without any temp var
Answer / aravind
#include<stdio.h>
char reverse(char *, char *);
int main()
{
char a[]="hello"
char b[]="world";
gets(a,b);
puts(a); /*displays Hello world*/
reverse(a,b);
char reverse(char *ptr, char *ptr1)
{
int i,j;
for(i=0;i!='\0';i++)
{
printf("%s",*ptr);
ptr++;
}
for(j=0;j!='\0';j++)
{
printf("%s",*ptr1);
ptr1++;
}
gets(*ptr1,*ptr);
puts(*ptr1); /*displays world hello*/
}
Is This Answer Correct ? | 0 Yes | 10 No |
How would you rename a function in C?
What is an object?
how can f be used for both float and double arguments in printf? Are not they different types?
what is ANSI and ISO
What are extern variables in c?
Compare array data type to pointer data type
how to create duplicate link list using C???
The differences between Windows XP and Windows Visa
Which of these functions is safer to use : fgets(), gets()? Why?
write a program to generate 1st n fibonacci prime number
What does static variable mean in c?
What does void main return?