About 2,610,000 results
Open links in new tab
  1. How to input a string array in C++ - Stack Overflow

    Dec 4, 2013 · You should consider using std::vector<string> name;, rather than a fixed-size array, and adding names with push_back(), to avoid the ugly range checks in my code or the …

  2. How to Take Input in Array in C++? - GeeksforGeeks

    Oct 5, 2023 · C++ Program to Take User Input in an Array using scanf() We can also use scanf() function to take input but then we have to specify the type of data and pass the address of the …

  3. C++ User Input Strings - W3Schools

    User Input Strings. It is possible to use the extraction operator >> on cin to store a string entered by a user:

  4. C++ Strings (With Examples) - Programiz

    In this tutorial, you'll learn to handle strings in C++. You'll learn to declare them, initialize them and use them for various input/output operations.

  5. Understanding C++ String Array - DigitalOcean

    Aug 4, 2022 · C++ provides us with ‘string’ keyword to declare and manipulate data in a String array. The string keyword allocates memory to the elements of the array at dynamic or run …

  6. Array of Strings in C++ - GeeksforGeeks

    Feb 26, 2025 · The general syntax of array of strings is: string arr_name[size] where arr_name is the name assigned to the array and size is the desired size. Understanding how to create and …

  7. String Array C++: Implementation & Representation With

    Apr 1, 2025 · A string array in C++ is an array of strings. In this tutorial, we will dig into the details of the representation & implementation of string arrays in C++.

  8. how to store an input into an array? C++ - Stack Overflow

    Aug 3, 2011 · So you can get input into a string, instead, and the cout statements you wrote, should work. However, they will be char s and not ints, so you would be storing '1' and '0' …

  9. How to take input of an array in 1 line in C++?

    Aug 3, 2013 · For arrays a trick is to use range based for loop: (Also works with vectors) T arr[N]; for(T &i:arr)cin>>i; If you use vectors, use this: (Arrays doesn’t work here) // Add this template …

  10. How to use scanf to input strings into an array in C language?

    To input an array of strings in C language, the scanf function can be used. Here is a common way to input strings arrays using scanf: # include <stdio.h> int main () { char str[ 100 ]; printf ( "请输 …