Bonjour,
J'ai un problème pour réaliser une classe en C++ .net.
Je voudrais exécuter la fonction RandomPoids() quaund je clique sur le bouton dans la Form1.
Dans le fichier Ia.h :
#pragma once
struct Neuron {
double* dw;
};
struct Couche {
int nNumNeurons;
Neuron* pNeurons;
};
public ref class Rn {
Couche* pCouches;
public:
void RandomPoids();
};
Dans le fichier Ia.cpp :
#include "StdAfx.h"
#include "Ia.h"
void Rn::RandomPoids()
{
for( int i = 1; i < 10; i++ )
pCouches[i].pNeurons[i].dw[i] = 0.0;
}
Dans le fichier Forom1.h :
#pragma once
#include "StdAfx.h"
#include "form2.h"
#include "Ia.h"
Rn Ia; ////////////
.
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
Ia.RandomPoids(); // ici, ça bug. Je n'arrive pas à exécuter RandomPoids();
Form2 ^maForm2 = gcnew Form2();
maForm2->richTextBox1->AppendText("test");
maForm2->Show();
}
Merci beaucoup
@+