B
brulsmurf
Ok iam despered, in Main of this code the object 'two' is looking as
should be when i print it, but the exact same code in procedure
"duTest" makes the object
filled up with additional strange values. I played with this code for
hours but i cant find the problem. Plz help me
#include "genetic.h"
#include "neuron.h"
#include "network.h"
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
void duTest()
{
DNA one(0);
UniversalNeuron two;
one.addAllel(4);
one.addAllel(4);
one.addAllel(1);
one.addAllel(3);
one.addAllel(3); //filling up one.
two.insertDNA(one);
two.show(); // Why dont it work??
}
int main()
{
int dummie;
DNA one(0);
UniversalNeuron two;
one.addAllel(4); // filling up one.
one.addAllel(4);
one.addAllel(1);
one.addAllel(3);
one.addAllel(3);
cout << "\nHere duTest routine\n";
duTest(); // doesnt work <-- inside here two gets filled
//with the right values, but also with some strange values
two.insertDNA(one); // works
two.show(); // ^^ <--this works fine,two is not
//filled with strange values
scanf("%d",&dummie); // press key..
return(1);
}
////// paste from other file VV
class UniversalNeuron
{
public: //
UniversalNeuron();
UniversalNeuron(int nS ,int gS, int dS, int daS);//
~UniversalNeuron();
UniversalNeuron(UniversalNeuron const &other);
void operator=(UniversalNeuron const &other);
void insertDNA(DNA &d); // <-- maybe interesting for
// solving problem ???
void show();
etc etc
should be when i print it, but the exact same code in procedure
"duTest" makes the object
filled up with additional strange values. I played with this code for
hours but i cant find the problem. Plz help me
#include "genetic.h"
#include "neuron.h"
#include "network.h"
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
void duTest()
{
DNA one(0);
UniversalNeuron two;
one.addAllel(4);
one.addAllel(4);
one.addAllel(1);
one.addAllel(3);
one.addAllel(3); //filling up one.
two.insertDNA(one);
two.show(); // Why dont it work??
}
int main()
{
int dummie;
DNA one(0);
UniversalNeuron two;
one.addAllel(4); // filling up one.
one.addAllel(4);
one.addAllel(1);
one.addAllel(3);
one.addAllel(3);
cout << "\nHere duTest routine\n";
duTest(); // doesnt work <-- inside here two gets filled
//with the right values, but also with some strange values
two.insertDNA(one); // works
two.show(); // ^^ <--this works fine,two is not
//filled with strange values
scanf("%d",&dummie); // press key..
return(1);
}
////// paste from other file VV
class UniversalNeuron
{
public: //
UniversalNeuron();
UniversalNeuron(int nS ,int gS, int dS, int daS);//
~UniversalNeuron();
UniversalNeuron(UniversalNeuron const &other);
void operator=(UniversalNeuron const &other);
void insertDNA(DNA &d); // <-- maybe interesting for
// solving problem ???
void show();
etc etc