About 396,000 results
Open links in new tab
  1. c++ - How to use a while loop with an array? - Stack Overflow

    Apr 14, 2016 · while (!done && count < SIZE) { cout << "Enter a grade #" << count + 1 << " or done to quit: "; string input = ""; cin >> input; if (input == "done") { done = true; } else { …

  2. 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 …

  3. C++ Loop Through an Array - W3Schools

    Loop Through an Array. You can loop through the array elements with the for loop. The following example outputs all elements in the cars array:

  4. looping through array of string elements - C++ Forum - C++ Users

    May 25, 2015 · One is a while loop, that just checks if you already entered a valid answer. You can use a bool type of condition, say. while(!validAnswer) //Initiate dialogue with user. cout << …

  5. C++ Array with while loop - Stack Overflow

    Your arrays should be type strings, rest of the code should look like this: for(int x=0;x<10;x++) { cout<<"Enter first name: "; cin>>fname[x]; count<<"Enter last name: "; cin>>lname[x]; } …

  6. Arrays with Loops - Educative

    Learn to use arrays with the help of loops in C++. The individual values in an array are accessed through an index number. The for loop variable can be used as an index number. The …

  7. How to Loop Over an Array in C++? - GeeksforGeeks

    May 21, 2024 · In this article, we will learn how to loop over an array in C++. Example: Output: . For iterating through an array, we create a loop that iterates the same number of times as …

  8. C++: Loop Through a String - Online Tutorials Library

    C++: Loop Through a String - Learn how to efficiently loop through a string in C++. Understand different methods and best practices for string manipulation in C++ programming.

  9. C Programming | Iterate List of Strings with While Loop - LabEx

    Learn how to iterate through a list of strings using a while loop in C programming. Explore an example that prints each string in an array until the end of the list.

  10. C++ While Loop - W3Schools

    Loops can execute a block of code as long as a specified condition is reached. Loops are handy because they save time, reduce errors, and they make code more readable. The while loop …

Refresh