Re: Help: C++ String Programming Software Development by VernonDozier itoa isn't standard. I don't know why. But since it isn't standard, some compilers will have it, some won't. You can either find a compiler that has it, write your own, or use a standard function like sprintf. I suggest going with options 2 or 3. Re: convert string to integer Programming Software Development by Banfa itoa is not an ANSI/ISO standard function and is non-portable, also it converts an integer to a string not a string to an integer. Try atoi or strtol Re: stripping digits Programming Software Development by Asif_NSU itoa isn't a standard function, so it may not be … you tell me what is the most common implementation of itoa if it's there? I guess it's using static… Re: STL iota not found Programming Software Development by sfuo itoa() is in <cstdlib> but is non-standard (meaning it is not implemented by all compilers). [This](http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/) page shows an example of an alternative method using sprintf(). I'm pretty sure you could also use stringstream. Re: to convert from int to char Programming Software Development by Colin Mac itoa is a non-standard function. Have a look at sprintf instead. [url]http://www.cplusplus.com/reference/clibrary/cstdio/sprintf.html[/url] Re: high digit numbers Programming Software Development by iamthwee itoa is non standard and atoi is a much maligned function. However, the use of atoi is not an issue (since this is c++) you should just use stringstreams. Re: number in a string Programming Software Development by iamthwee itoa doesn't even exist in the standard. Use this for … itoa () Implementation Need Improvements Programming Software Development by Sky Diploma … Improvements in this code. [CODE=C++] /**************************************************************************** Function Name:: itoa(int ,char [] ) Written By:: Susheel Kumar Date:: Saturday…include <iostream> #include <cstring> char* itoa(int a, char b[]); //Target Function; //Functions Declarations char … Re: itoa () Implementation Need Improvements Programming Software Development by Sky Diploma … in my Programming Book. [CODE=C++] /**************************************************************************** Function Name:: itoa(int ,char [] ) Written By:: Susheel Kumar Date:: Saturday…include <iostream> #include <cstring> char* itoa(int a, char b[]); //Target Function; //Functions Declarations char … Re: itoa () Implementation Need Improvements Programming Software Development by VernonDozier If you are asking about ways you can improve it, if you look at [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/"]itoa[/URL], it needs to be able to handle negative numbers and it needs to be able to handle different bases: [code] char * itoa ( int value, char * str, [COLOR="Red"]int base[/COLOR] );[/code] Re: itoa () Implementation Need Improvements Programming Software Development by WaltP … at [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/"]itoa[/URL], it needs to be able to handle negative… needs to be able to handle different bases: [code] char * itoa ( int value, char * str, [COLOR="Red"]int base… Re: itoa function (or similar) in Linux Programming Software Development by ArkM … range). Fortunately, it's so simple to get itoa portable solution: [code=c] /* The Itoa code is in the puiblic domain */ char…* Itoa(int value, char* str, int radix) { static char dig… itoa for char array mid elements Programming Software Development by ssmg … everyone, I don't know if I'm confused with itoa,excuse me for this if so, but what I'm… to fill the next char with an integer using itoa: [CODE]example[4]=itoa(i,example[4],10);[/CODE] where i is… itoa function (or similar) in Linux Programming Software Development by marcosjp … value into a string? I used the itoa function successfully in Windows: [code=c]itoa(the_int_number, the_string, 10);[/code] It worked fine… Re: itoa function (or similar) in Linux Programming Software Development by ArkM … VC++ 2008 solution... [code=c] /* The Itoa code is in the public domain */ char* Itoa(int value, char* str, int radix) { static… Re: itoa for char array mid elements Programming Software Development by jonsca This is an ideal situation which which to use stringstreams. Are you locked into using the characters array? Also, itoa is non-standard so it's not guaranteed to be available on all compilers. Re: itoa function (or similar) in Linux Programming Software Development by ssharish2005 Use sprintf function to convert int to string. Thats the more portable way of doing it. Since itoa is not portable! [code="c"] char *cvtInt( char *str, int num) { sprintf( str, "%d", num ); } [/code] ssharish some issues with itoa Programming Software Development by MaestroRage … char. It all works until I hit the itoa line. Then it gives me a access violation error… the actual implementation. I found many examples using itoa in single arrays (as strings are all 1d …Inventory[arrayIter][1]) + atoi(wildItems[storeSpots[itemSelect-1]][1]); itoa(x,Inventory[arrayIter][1],10); } else if (Inventory[arrayIter… Trying to write itoa Programming Software Development by AnujSuper9 …am supposed to write the code for the itoa function [icode]char* itoa(int Value, int Base);[/icode] without … making are appropriate/accurate and etc. [code=c++] char* itoa(int val, int base){ static char buf[32] = {…Here's my current, pseudo-codey implementation: [code=c++] char* itoa(int val, int base){ static char buf[36] = {0… Re: Trying to write itoa Programming Software Development by WaltP … I am supposed to write the code for the itoa function [icode]char* itoa(int Value, int Base);[/icode] without using any… Re: Trying to write itoa Programming Software Development by AnujSuper9 Hmmm, ok. Let me make some adjustments. [code=c++] char* itoa(int val, int base) { new static char* buf[32] = {0}; //… of the caller? I was worried that if two consecutive itoa() calls were made, and then they were both output, that… Re: Trying to write itoa Programming Software Development by ArkM …'t save actual memory expenses. Another defects: 2. The RTL itoa allows bases in the range 2..36 however you provide… epilogue)... 8.... My implementation has the same defect as RTL itoa: possible buffer overflow. Re: Trying to write itoa Programming Software Development by skatamatic …'m missing something... As for the negative: [code=cplusplus] char * itoa(int iNum, int iBase) { char* buf = new char[32]; int… Re: Trying to write itoa Programming Software Development by AnujSuper9 … current implementation: [code=c++] #include <stdio.h> char* itoa(int value, int base) { static char* buf = new (char [32… Re: Trying to write itoa Programming Software Development by AnujSuper9 … base it on that. Here it is: [code=c++] char* itoa(int value, int base) { int valuecopy; valuecopy = value; int bufsize… Re: Trying to write itoa Programming Software Development by AnujSuper9 … would solve the problems I think. So... [code=c++] char* itoa(int value, int base) { int valuecopy1, valuecopy2; valuecopy1 = value; if… Re: Trying to write itoa Programming Software Development by AnujSuper9 … would be much appreciated. My current implementation: [code=c++] char* itoa(int Value, int Base) { //making copies of the absolute value… Re: Trying to write itoa Programming Software Development by ArkM … of the caller". It's exactly your case: your itoa(0,10) returns buf+1 address. It seems you didn… Re: Trying to write itoa Programming Software Development by AnujSuper9 … complete and functional version of this problem: [code=c++] char* itoa(int Value, int Base) { //making copies of the absolute value… gcc vs code blocks with itoa Programming Software Development by COKEDUDE My understanding of code blocks is that it uses gcc. So I am curious why gcc allows you to have a function called itoa, but code blocks does not let you have a function called itoa. Does anyone know?