A
A
AirFlare2022-03-03 16:20:43
C++ / C#
AirFlare, 2022-03-03 16:20:43

How to put in char int?

Good day. There are: char *p;. You need to enter numbers into it without adding them . To come out like this: 9325.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wataru, 2022-03-03
@AirFlare

Use sprintf . Just allocate enough memory for the string first.
If there is not a fixed number of numbers and you cannot write them all with one call, then you need to save the value returned by sprintf and write the next number already shifted by this number of bytes.

C
CityCat4, 2022-03-04
@CityCat4

char *p is a pointer to a string. Only a pointer can be entered into it. Explain more precisely and competently - what you need.
If you need to put in a string (assuming you did not forget to allocate memory) a text display of a number - then this is sprintf ()
If you need to put the number itself (which will NOT be displayed in text, of course) - this is memmove ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question