#include <iostream>
#include <ctime>
int main(void)
{
srand((unsigned)time(NULL));
int iRand_Num = rand()%20+1;
int iArray[iRand_Num] = {0};
system("pause");
}
Errors:
------ Build started: Project: Sort Array, Configuration: Debug Win32 ------ Compiling... main.cpp c:\documents and settings\james\desktop\sort array\sort array\main.cpp(9) : error C2057: expected constant expression c:\documents and settings\james\desktop\sort array\sort array\main.cpp(9) : error C2466: cannot allocate an array of constant size 0 Build log was saved at "file://c:\Documents and Settings\James\Desktop\Sort Array\Sort Array\Debug\BuildLog.htm" Sort Array - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks... I'm going to go jump off my roof now.
This post has been edited by skyhawk133: 21 August 2007 - 05:48 PM

New Topic/Question
Reply




MultiQuote





|