ive declared and integer array and i need to know how the user can input a single input of "2 4 6 3 5 6 7 5 3 5 6" and get each individal digit into each index of the array and help would be greatly appreciated.
pkfx
0
Newbie Poster
Recommended Answers
Jump to PostI'm assuming you're reading the entire input into a single string. You'll need to first break this string up into individual "words", or items separated by whitespace. Then each word will need to be converted to an integer and assigned to the array.
For example:
#include <iostream> …
All 4 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
pkfx
0
Newbie Poster
pkfx
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
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.