Thread: Quick help...array q's

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    16

    Exclamation Quick help...array q's

    can one array be copied into another array with the following statement:
    Code:
    int x[5], y[5];
    .....
    x=y;        ???

    How SHOULD this array :
    Code:
    int value [20]
    for (n=0; n,19; n++)
         cout << values [n];
    be passed to Somefunc()

    How do you write a for loop to allow the user to input new values into an array?
    sample array:
    Code:
    int values[20];
    Quick help is greatly appreciated...
    Thanks for everything

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    can one array be copied into another array with the following statement:
    Try it. What happens?

    How SHOULD this array :
    Code:
    int value [20]
    for (n=0; n,19; n++)
         cout << values [n];
    be passed to Somefunc()
    Somefunc(value);
    How do you write a for loop to allow the user to input new values into an array?
    sample array
    Post some code. Let's see what you've tried. Think of an array of size 10, e.g.

    int values[10];

    as 10 variables: values[0], values[1], .... values[9]. How would you input data into 10 variables?
    Last edited by 7stud; 11-02-2005 at 01:26 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick Array Problem
    By JaydinBane in forum C Programming
    Replies: 6
    Last Post: 04-03-2009, 11:54 PM
  2. Modify an single passed array element
    By swgh in forum C Programming
    Replies: 3
    Last Post: 08-04-2007, 08:58 AM
  3. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  4. Array Program
    By emmx in forum C Programming
    Replies: 3
    Last Post: 08-31-2003, 12:44 AM
  5. Quick Q - Array to File
    By C-Struggler in forum C Programming
    Replies: 4
    Last Post: 03-21-2003, 04:16 PM