how to convert int to string??

how to convert int to string??

Post by Ka Hing La » Sat, 22 Aug 1998 04:00:00



i am working on a simple program. i have to pass message
between children created by fork. i use pipe to link every two
children. the problem is i have to pass integer in the message
as well. so i would like to convert int to string so that i can
pass the message around. or if there any possible solution to this
(like passing a structure. i don't really how know to do it)
any idea, thanks!!

Errol

 
 
 

how to convert int to string??

Post by Gerfried Fuch » Sat, 22 Aug 1998 04:00:00



> i am working on a simple program. i have to pass message
> between children created by fork. i use pipe to link every two
> children. the problem is i have to pass integer in the message
> as well. so i would like to convert int to string so that i can
> pass the message around. or if there any possible solution to this
> (like passing a structure. i don't really how know to do it)
> any idea, thanks!!

> Errol

man 3 sprintf
 With that function you do quite the same as with fprintf but to a
string and not to a stream.
--
.-Gerfried-"Alfie"-Fuchs-.    \ \ \ \    / ___/ Music was my first love

|  http://come.to/alfie  |  / /_\ \ \_______/   ()  Free Speech Online
'currently^not^available!' /_______\  /_/       /\ Blue Ribbon Campaign