C++

Sharky Forums


Results 1 to 5 of 5

Thread: C++

  1. #1
    Sushi
    Join Date
    Nov 2001
    Location
    Fremont, Ca, USA
    Posts
    1

    Question C++

    How do you write a statement that declares a standard array of three *******s, initialized to 1, 2, and 4?

  2. #2
    Catfish
    Join Date
    Jun 2001
    Posts
    130

    Post

    int arr[3]={1,2,4};

    That's it.
    AMD 1.2GHz Athlon 266FSB w/GlobalWin CAK38
    Asus A7M266
    Kingston PC2100 2x 256MB
    IBM 75GXP ATA100 7200RPM 45GB
    Creative 12x DVD
    Yamaha 4x4x16x CD-RW
    Matrox G400 Millenium
    Matrox Rainbow Runner TV-Tuner/Capture Card
    SB Live! 5.1 Platinum
    Creative Dxr3 Decoder Card
    3Com 3C905B 10/100 NIC
    Mitsubishi 900u
    Antec PP403X 400W PSU
    In-Win Q500

  3. #3
    Texan Dragon Moderator Galen of Edgewood's Avatar
    Join Date
    Sep 2000
    Location
    Ft Irwin, CA
    Posts
    5,602

    Post

    Originally posted by driver:
    int arr[3]={1,2,4};

    That's it.
    Would you stop beating me to answers that I actually know.

    Great havin' you around, driver.

    ------------------
    Dragon of the OC Crusaders

    The race is not always to the swift, nor the battle to the strong, but that's the way to bet.
    -- Damon Runyon
    Dragon of the OC Crusaders

    Break the rules and you're snack food for this dragon...

  4. #4
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Washington DC
    Posts
    1,286

    Post

    Just remember though that when accessing the array the locations starts at zero so arr[0] = 1, arr[1] = 2, and arr[2] = 4

  5. #5
    Mako Shark dighn's Avatar
    Join Date
    Nov 2000
    Location
    Vancouver, BC Canada
    Posts
    3,171

    Post

    sounds like assignment

    ------------------
    Keep it brief
    .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •