Thread: Question array loop

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    It's <cstdlib> BTW.

    I'm sure if the OP turns that in (assuming it's homework) the teacher would be suitably impressed . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #2
    Registered User Noir's Avatar
    Join Date
    Mar 2007
    Posts
    218
    It's <cstdlib> BTW.
    Either works.
    I'm sure if the OP turns that in (assuming it's homework) the teacher would be suitably impressed . . .
    That's why I posted it. I like impressing teachers who aren't my teachers but end up getting my code for assignments anyway.

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    6
    its not homework lol just been watching a few c++ video and it says to try do this could it also be done like this ?

    #include <iostream>
    int main(){

    //intilize my array with 10 values
    int my array[10];

    //Random value to array
    1[0] = 5;
    2[1] =10;
    //so on so on

    //how would I loop this ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  2. question about multidimensional arrays
    By richdb in forum C Programming
    Replies: 22
    Last Post: 02-26-2006, 09:51 AM
  3. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM