473,387 Members | 1,757 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,387 software developers and data experts.

about strings converting integer value to string

2
Hii
I am jhon.
I have doubt in how to convert integer value to character string without using string library functions like intToStr(-899)
give the string in -899
like that......................................
Feb 2 '14 #1
3 1208
weaknessforcats
9,208 Expert Mod 8TB
If you have a number, like 243 you can:

1) Do 243/100 to get 2. Add 60 to convert to the character '2'.
2) Do 243 - 2 * 100 to get 43.
3) Do 43/10 to get 4. Add 60 to convert to the character '4'
4) Do 43 - 4* 10 to get 3.
5) Add 60 to 3 to convert to the character '3'.

You can put this in a loop that cycles for the max size of an integer.
Feb 2 '14 #2
jcena
2
Thank you...
please give me sample code for this....
Feb 9 '14 #3
weaknessforcats
9,208 Expert Mod 8TB
You can't learn how to do this unless you do it yourself.

Have a try at it and post your code if you are stuck.
Feb 9 '14 #4

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

Similar topics

1
by: Peter Warder | last post by:
I'm still struggling with these conversions! The wider code is working well but I can't get the compiler to accept my attempts at converting Integers (back) into Strings. What's the trick? ...
7
by: Sashi | last post by:
Two questions: (1) I can pull the text of an XML element as a string just fine using code as such: strSomeString = myXmlDoc.SelectSingleNode("/Element1/Element2/Element3",...
22
by: hantie | last post by:
In my program, for reducing the complexity, the integer was stored as char, so 2 is stored as '2', which is decimal: 50 Is is possible for me to obtain the integer value of '2' in the program,...
5
by: Joergen Bech | last post by:
Basically, I want to convert hex values in the range "00000000" to "FFFFFFFF" to a signed, 32-bit Integer value. In VB6, I could just write lngValue = Val(hexstring$). In VB.Net, I seem to be...
8
by: jobo | last post by:
Hello, If I'm given a string that always starts with the word "free" followed by an integer ("free xx"). How do I parse through the characters and get to the integer value? Thanks.
8
by: Polaris431 | last post by:
I have a buffer that holds characters. Four characters in a row represent an unsigned 32 bit value. I want to convert these characters to a 32 bit value. For example: char buffer; buffer =...
5
by: J.Broeden | last post by:
Hi, I've written a some code to assist in my understanding of strings using some of Cs built in character handling functions but I am not sure why I'm getting the following error. I hope someone...
3
by: Krupa Kiran | last post by:
Hi i have function in script. I did a small calculation in that function when i try to pass a value to in Field thet only passes integer value. But i need to pass both String and the integer value....
6
by: phpmagesh | last post by:
Hai friends, {$PRODUCTS_PRICE} This is my variable i dont know why they used { } for that. in that product_price i m storing a integer value like 112.00 etc.., when i change to another radio...
1
by: Anitha Manickam | last post by:
can u help me to get below example table field status holds Integer, Status 0 1 I need to display in runtime like Status User
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.