hi
first of all greeting to every one
i want to convert integer value into digits
like
input into any variable x=234678
into
store in array y[8] that y[0]=2,y[1]=3 and so on.
how can i do that
in c++
Kashif
0
Junior Poster in Training
Recommended Answers
Jump to Post#include <cstdio> std::sprintf ( y, "%d", x );
Jump to Postatoi() converts a null terminated char array into an integer value (strtox() functions may be a better choice for this) rather than convert an integer value into a null terminated char array. The three options I'm aware of to turn integers into null terminated char array include:
1) sprintf(), …
All 6 Replies
Narue
5,707
Bad Cop
Team Colleague
Kashif
0
Junior Poster in Training
Lerner
582
Nearly a Posting Maven
Kashif
0
Junior Poster in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Kashif
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.