473,394 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Converting negative integers to ASCII string

3
Hi..

I am trying to write a program itoa() that can convert negative integers to ASCII string. Any help on how to do it would be much appreciated.

Thanks,
Amyly
Dec 17 '08 #1
6 7333
gpraghuram
1,275 Expert 1GB
Hi,
I think in K&R C book tor the K&R Answer book this is there.
Take a look into it.

Raghu
Dec 17 '08 #2
Parul Bagadia
188 100+
itoa() takes 3 parameters,
1st parameter- number to be converted
2nd parameter-string where you want to store after conversion.
3rd parameter- radix,.. base...in case of negative values it's 10.
Check the Help of Turbo C++/C u'll find detailed description with examples of all in built functions..
Dec 17 '08 #3
Amyly
3
Thank you for the response. My program itoa(number, storage, 10) converts a unsigned integer but does work when it is singned integer.. I gooogled for the tutorials but i dont find anything on it.. If any of you know, could you post a link here?
Dec 17 '08 #4
JosAH
11,448 Expert 8TB
Here you are: itoa - C++ Reference

kind regards,

Jos
Dec 17 '08 #5
donbock
2,426 Expert 2GB
You refer to "my program itoa". Are you writing your own itoa function or using the itoa function provided by the Standard Library?
Dec 17 '08 #6
Amyly
3
I was writing my own itoa().. Had a problem with converting SIGNED integer but i got it fixed now.. Thanks Jos for posting the link and Thanks to everybody for your response.
Dec 18 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Willem | last post by:
What is the best way to calculate an ascii string into an integer (not talking about an atoi conversion): For examle if I have the ascii string: "/b" then in hex it would be 2F7A and if I...
4
by: Luk Vloemans | last post by:
Hey, I'm currently working on a project to get GPS-data onto a PDA. At this stage, I'm already getting data from the device, but my problem is: It's rubbish. At least, it looks as if it were...
3
by: Michel Racicot | last post by:
I need to read a null terminated ASCII string from a FileStream. How can I do that? I know that with FileStream.ReadByte, I can read until I get a byte == 0 but how can I convert a single byte to...
2
by: Claire | last post by:
Would someone give me a code example that reads an ASCII string from a binary reader and converts it to a c# string please. I find that the help files aren't very clear on how do do this eg "DATA"...
2
by: Roy Rodsson via .NET 247 | last post by:
Hi all! I am using a stored procedure in SQL2000 for retrieving fileinformations from a db. the table as an uniqueidentifier for the file information. The stored procedure has a variable...
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
3
by: Steven D'Aprano | last post by:
Problem: I have an application where I need to print integers differently depending on whether they are positive or negative. To be more specific, I have to print something that looks like: ...
1
by: mfunkmann | last post by:
Hi there, I have a really strange conversion-problem here: -- string _content = new string("some data"); ... System.Text.Encoding _Convert= new System.Text.ASCIIEncoding();
2
by: John Nagle | last post by:
I'm trying to clean up a bad ASCII string, one read from a web page that is supposedly in the ASCII character set but has some characters above 127. And I get this: File...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.