Search Results

Search found 2 results on 1 pages for 'aleator'.

Page 1/1 | 1 

  • Multiple Haskell cabal-packages in one directory

    - by aleator
    What is the recommended way of having several cabal packages in one directory? Why: I have an old project with many separable modules. Since originally they formed just one program it was, and still is, handy to have them in same directory for easy compiling. Options Just suffer and split everything, including VCS holding the stuff, into different directories? Hack cabal until it is happy with multiple .cabal files in same directory? Make another subdirectory for each module and put .cabal files there along with symlinks to original pieces of code? Something smarter? What?

    Read the article

  • C++ program crashes at runtime

    - by qwerty
    Hello, I have this simple c++ program #include <cstdlib> #include <iostream> #include <math.h> #include <stdlib.h> #include <time.h> #include <vector> using namespace std; int aleator(int n) { return (rand()%n)+1; } int main() { int r; int indexes[100]={0}; // const int size=100; //int a[size]; std::vector<int>v; srand(time(0)); for (int i=0;i<25;i++) { int index = aleator(100); if (indexes[index] != 0) { // try again i--; continue; } indexes[index] = 1; cout << v[index] ; } cout<<" "<<endl; system("pause"); return 0; } But at runtime it crashes, so i got that error with 'Send error report' and 'Don't send'. What i'm doing wrong? Thanks!

    Read the article

1