Quote Originally Posted by NinchN
Hi,

I just started programming in C++,
Code:
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <string>

using namespace std;

int main()
{
    
    int maxalleles=10;
    double freq[maxalleles], margw[maxalleles], mutant[maxalleles];
    double w[maxalleles][maxalleles]; 
    for (int i=1; i<=maxalleles; ++i){
For array dimensions equal to 10, the subscripts go from 0 to 9:

Code:
    for (int i = 0; i < maxalleles; ++i){
Regards,

Dave