Problems with a pointer

Hello, i got a problem with a pointer and i can't find it<

Its a little program to store some number(an assignement)

This is my .H

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

const int iMIN = 0;
const int iMAX = 100;
const int iVALEUR_DEFAUT_INTERVALLE = 10;


class CHistogramme
{
public:
	//Accesseurs
	int GetNbIntervalles() const;
	int GetValMinIntervalle(int iLequel) const;
	int GetValMaxIntervalle(int iLequel) const;
	int GetFrequenceIntervalle(int iLequel) const;
	
	
	int GetNbRejets() const;

	//Mutateur
	void SetValeur(int iValeur);

	//Constructeur et destructeurs
	CHistogramme (int iNb_Intervalle_Ask);
	CHistogramme (const CHistogramme &oDroite);
	virtual ~CHistogramme ();

private:
	//Données membres
	int *iTabIntervalles_;
	int iNbRejets_;
	int iNb_Intervalle;
};


So i declare a pointer named *iTabIntervalles_

Then i create the dynamic array with a dynamic allocation, this is where i have the problem

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include "CHistogramme.h"
using namespace std;


//Constructeur CHistogramme
//Créé le tableau de valeur et l'initialise a 0 pour toutes les données
//Initialise quelque variables clées
CHistogramme::CHistogramme(int iNb_Intervalle_Ask)
{

	if ((iNb_Intervalle_Ask >= 1) && (iNb_Intervalle_Ask <=101))
	{
		iNb_Intervalle = iNb_Intervalle_Ask;
	}
	else
	{
		iNb_Intervalle = iVALEUR_DEFAUT_INTERVALLE;
	}
	this->iTabIntervalles_= new int [iNb_Intervalle];

	for(int iCpt = 0 ; iCpt < iNb_Intervalle ; iCpt++)
	{
		iTabIntervalles_[iCpt] = iMIN;

	}
		iNbRejets_ = 0;
}


Error in VS

1
2
1>chistogramme.cpp(88) : error C2039: 'iTab_Intervalles_' : n'est pas membre de 'CHistogramme'
1> chistogramme.h(9) : voir la déclaration de 'CHistogramme' 

First one says iTab_Intervalles is not a member of the class
Second return to the destructor wich is:

1
2
3
4
CHistogramme::~CHistogramme()
{
	delete [] this->iTab_Intervalles_;
}
1
2
iTabIntervalles_
iTab_Intervalles_
Damn thx, stupid mistake
Topic archived. No new replies allowed.