By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,496 Members | 2,117 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,496 IT Pros & Developers. It's quick & easy.

ulltostr

P: n/a
Hello,
Can someone tell me how to use the ulltostr function?
This converts a long int to a string.
Can someone show me a short piece of code? Thanks.
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 2005-11-18, Mike <lo*******@yahoo.com> wrote:
Hello,
Can someone tell me how to use the ulltostr function?
This converts a long int to a string.
Can someone show me a short piece of code? Thanks.


My system doesn't have such a function.
Nov 18 '05 #2

P: n/a

Mike wrote:
Hello,
Can someone tell me how to use the ulltostr function?
This converts a long int to a string.
Can someone show me a short piece of code? Thanks.


ulltostr is not in standard C. Perhaps you should check the manuals
on your system (try "man ulltostr" if this is Solaris as I'd guess) or
ask
in a newgroup dedicated to that OS. comp.unix.solaris or
comp.unix.programmer perhaps?

-David

Nov 18 '05 #3

P: n/a
Mike said:
Hello,
Can someone tell me how to use the ulltostr function?
This converts a long int to a string.
Can someone show me a short piece of code? Thanks.


There is no ulltostr function in standard C, but it's easy enough to write
one that matches your specification.

#include <stdio.h>

int ulltostr(char *s, long int n)
{
return sprintf(s, "%ld", n);
}

Followups set.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Nov 18 '05 #4

P: n/a
Richard Heathfield <in*****@invalid.invalid> writes:
Mike said:
Can someone tell me how to use the ulltostr function?
This converts a long int to a string.
Can someone show me a short piece of code? Thanks.


There is no ulltostr function in standard C, but it's easy enough to write
one that matches your specification.

#include <stdio.h>

int ulltostr(char *s, long int n)
{
return sprintf(s, "%ld", n);
}

Followups set.


<OT>But that's not consistent with the Solaris function of the same
name.</OT>

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 18 '05 #5

P: n/a
Keith Thompson wrote
(in article <ln************@nuthaus.mib.org>):
Richard Heathfield <in*****@invalid.invalid> writes:
There is no ulltostr function in standard C, but it's easy enough to write
one that matches your specification.

#include <stdio.h>

int ulltostr(char *s, long int n)
{
return sprintf(s, "%ld", n);
}

<OT>But that's not consistent with the Solaris function of the same
name.</OT>


OnTopic: But, since there is no standard function of that name,
there is no need for conforming code posted to CLC to adhere to
some non-standard implementation on a given platform.

--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.