|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Itoa () function mistake, people ask brothers Now this procedure is to test itoa (); However, the results of my expectations
So I ask where is not wrong
[code]
#include "Stdio.h>;
#include "Stdlib.h>;
Main () (
Int i=1111;
Char *a= "Panorama";
Chicken = char NULL;
Printf ( "%s\n", a);
Printf ( "%s\n", b);
Itoa (i, b,6);
Printf ( "%s", b);
}
[/code] |
Itoa () function mistake, people ask brothers To start reading!
Not so with the target!
Numerical should become strings, please use sprintf. |
Itoa () function mistake, people ask brothers The result is that I
Panorama
[null]
Then mistakes |
Itoa () function mistake, people ask brothers The third sentence is not right, Print
I think it is my itoa () to no avail |
Itoa () function mistake, people ask brothers Thank you |
Itoa () function mistake, people ask brothers B at the memory of what you ah, ah not designate specific areas how to export |
Itoa () function mistake, people ask brothers Itoa which thus can tell me? |
Itoa () function mistake, people ask brothers Use sprintf |
Itoa () function mistake, people ask brothers B not allocated memory space, it may try to char b[10]; |
Itoa () function mistake, people ask brothers Have itoa ()? In what base? |
Itoa () function mistake, people ask brothers
| Itoa () function mistake, people ask brothers I uncovered a bit Unix, no itoa function, but according to the meaning of the landlord, it should be put into plastic string
#include "Stdio.h>;
#include "Stdlib.h>;
Main () (
Int i=1111;
Char *a= "Panorama";
Chicken = char NULL;
Printf ( "%s\n", a);
Printf ( "%s\n", b);
Itoa (i, b,6);
Printf ( "%s", b);
}
B = 0x00 here is a guide, that is to say, not at the memory used itoa (i, b,6); Say "1111" box data into the memory address of 0, the address of which is devoted wave reservation system, can be used in application procedures. |
Itoa () function mistake, people ask brothers Guidelines is the problem
Now it can be replaced after the
[code]
#include "Stdio.h>;
#include "Stdlib.h>;
Main () (
Int i=1234;
Char s[5];
Itoa (i, s,10);
Printf ( "%s\n", s);
}[/code]
Itoa () which in stdlib.h
There are three parameters :
The first data entry, the second output data, and the third is several 229, 229 10 For example, two 229
Thank you :) |
| |