943,974 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2169
  • C++ RSS
Jul 23rd, 2004
0

don't understand

Expand Post »
this is a copy of c language that i copied from the date of 19 july.
i just started to learn c++, so i don't really understand the syntax for c..
can some one explain to me how it works to "so called mirror" the words or integers. thank you
need it urgently....



#include <stdio.h>

char *f(char*s)
{char*t=s,*u=t;
while(*u)++u;--u;

while(t<u){char x=*t;*t++=*u;*u--=x;}return s;}

int main ( void )
{

char text[] = "bvx";
puts ( text );
puts ( f ( text ) );
return 0;
}



/* my output
The quick brown fox
xof nworb kciuq ehT
*/
Similar Threads
koh
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
koh is offline Offline
73 posts
since Jul 2004
Jul 23rd, 2004
0

Re: don't understand

Greetings, koh.
Check this thread out.
http://www.daniweb.com/techtalkforums/thread8074.html
Reputation Points: 53
Solved Threads: 1
Posting Whiz
red_evolve is offline Offline
313 posts
since Jun 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: File processing problem
Next Thread in C++ Forum Timeline: Saving a file using C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC