how to input a string into a char array cpp
#include <iostream>
#include <cstring>
int main() {
const int maxSize = 100; // Set the maximum size of the char array
char inputString[maxSize]; // Declare a char array to store the input string
std::cout << "Enter a string: "; // Prompt the user to enter a string
std::cin.getline(inputString, maxSize); // Use getline to input the string and store it in the char array
std::cout << "You entered: " << inputString << std::endl; // Display the entered string
return 0;
}