Thread: Array initializing to a function parameter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    24

    Array initializing to a function parameter

    Hi all..I have a little situation that I'd really like to know.
    I could have for example

    struct Something {
    int arr[7];

    Something(int _arr[]) {...}
    ~Something() {}
    };

    or

    int arr[5] and f(int _arr[]).

    So my question goes, how would u initialize arr[] during the call of f() so that f() gets the initialized values?

    I've tried normal initializing with {}:

    Something strange( Something({0, 3, 6, 7, 2}) );

    Compiling this causes an error. That's all i know for now?
    U'd be a big help with my project, thanks
    Last edited by JulleH; 01-17-2005 at 04:28 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  4. pointer to array as parameter to function
    By Jurgen in forum C++ Programming
    Replies: 1
    Last Post: 05-20-2004, 02:51 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM