Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8863231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:55:31+00:00 2026-06-14T15:55:31+00:00

string fruits[200]; How can I input a string into the array ? Example: My

  • 0

string fruits[200];

How can I input a string into the array ?

Example:
My mom has apples;
So , fruits array will contain:
fruits[0] = "My";
fruits[1] = "mom";
..........etc.

How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:55:33+00:00Added an answer on June 14, 2026 at 3:55 pm

    If you’re reading from the standard input:

    int i = 0;
    for (string word; cin >> word; i++)
        names[i] = word;
    

    If you’re reading from a string, use istringstream instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

params = {'fruit':'orange', 'color':'red', 'size':'5'} How can I turn that into a string: fruit=orange&color=red&size=5
I have a method like this- public List<Apples> returnFruits(String arg1){ List<Apples> fruits = new
Can I assign 0 value on an array that returned no results from a
Imagine I have a String array like this: String[][] fruits = {{Orange,1}, {Apple,2}, {Arancia,3};
When I write this String[] fruits = {Apple, Pear}; I would expect that at
I have a string array: String[] fruits = {Apple,Mango,Peach,Banana,Orange,Grapes,Watermelon,Tomato}; and i am getting random
I've have the following code example from Microsoft (http://msdn.microsoft.com/en-us/library/bb534869.aspx): String[] fruits = {apple, banana,
import json array = '{"fruits": ["apple", "banana", "orange"]}' data = json.loads(array) That is my
String.xml <string-array name=fruits> <item>Apple</item> <item>Banana</item> <item>Orange</item> <item>Pear</item> <item>Watermelon</item> <item>Mango</item> <item>Pineapple</item> <item>Strawberry</item> </string-array> <string-array name=total>
I have a string that looks identical to a list, let's say: fruits =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.