F0ra
Messages postés111Date d'inscriptionmardi 18 septembre 2007StatutMembreDernière intervention29 décembre 2008
-
15 avril 2008 à 19:11
F0ra
Messages postés111Date d'inscriptionmardi 18 septembre 2007StatutMembreDernière intervention29 décembre 2008
-
15 avril 2008 à 22:24
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();
}
F0ra
Messages postés111Date d'inscriptionmardi 18 septembre 2007StatutMembreDernière intervention29 décembre 2008 15 avril 2008 à 22:24
Ok,
En .net, ça ne fonctionne pas ce genre de chose.
J’en ai déjà réalisé une en VRAI C++ sans problème.
Merci quand même.
Je vais continuer à chercher.
@+