A
apple.davinci
as many as possible.
int i = 333;
char* s;
how to convert i to s;
int i = 333;
char* s;
how to convert i to s;
as many as possible.
int i = 333;
char* s;
how to convert i to s;
as many as possible.
int i = 333;
char* s;
how to convert i to s;
as many as possible.
int i = 333;
char* s;
how to convert i to s;
as many as possible.
int i = 333;
char* s;
how to convert i to s;
I can come up with as many different ways as you would like. Some are notas many as possible.
int i = 333;
char* s;
how to convert i to s;
as many as possible.
int i = 333;
char* s;
how to convert i to s;
CBFalconer said:void convert(int i) {
if (i < 0) putchar('-');
else i = -i;
while (i++ < 0) putchar('1');
putchar('\n');
}
Old said:Tsk tsk, UB if i == INT_MIN and INT_MIN < -INT_MAX.
Old said:Tsk tsk, UB if i == INT_MIN and INT_MIN < -INT_MAX.
it is not my homework.I can come up with as many different ways as you would like. Some are not
very efficient, some are.
For example, I can convert it to a string in base 2, base 3, ... base 12,
base 60, whatever.
I can just use sprintf(), or keep dividing by 10 (for base 10), or take the
log and do some fancy, stupid manipulation and finally get a string
representation.
You will have to be more specific about what you want. Or what your
professor wants.
[email protected] said:Fred Kleinschmidt 写é“:
said:it is not my homework.
Fred Kleinschmidt 写é“: [...]it is not my homework.You will have to be more specific about what you want. Or what your
professor wants.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.