Hello! I would like to ask if its possible to change the size of the array? For example, the user will input a characters then that characters will be counted and the size of the array will be change. For example of the output:
Enter your name: Laklaker
The size of the array is: 8.
laklaker
0
Light Poster
Recommended Answers
Jump to PostWhy use an array? Since you're just asking for the persons namr, you can do:
#include <string> #include <iostream> int main() { std::string name; std::cout << "Please enter your name: "; std::cin >> name; std::cout << "Size: " << name.length(); }
All 2 Replies
phorce
131
Posting Whiz in Training
Featured 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.