Find the answer to your Linux question:
Results 1 to 2 of 2
Thanks all! That solved it...
  1. #1
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,958

    [SOLVED] Really basic C++ Question

    Thanks all! That solved it
    Last edited by jmadero; 03-24-2010 at 04:52 PM.
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  2. #2
    Just Joined!
    Join Date
    Mar 2010
    Posts
    8
    You have a error in your code :

    Code:
    for ( int i = 0 ; i < size ; i++ )
    
    array1[ rand() ] ;
    Try with :

    Code:
    for ( int i = 0 ; i < size ; i++ )
    
    array1[i] = rand() % 100 ;
    Use rand() % 100 to generate a number from 0 to 100

Posting Permissions

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