bonjour à tous, j'ai un petit soucis pour retourner un tableau à 2 dimensions, afin de l'utiliser dans une autre fonction. Voici mon mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
int ** init_spectre(int N, int P)
{	
 
	int * signal_discret = new int[N]; 
	delete [] signal_discret;
 
	int i,i2,j,k;
	for (i=0;i<N;i++)
	{
		i2=i;
		j=0;
 
		for(k=1;k<=P;k++)
		{
			j=j<<1;
			j=j|(i2&1);
			i2=i2>>1;
		}	
	cout << "i=" << i2 << " et j=" << j << endl;
 
 
	vector<vector<int> >spectre(N, vector<int>(2));  
 
	spectre[j][0] = 0;   
    spectre[j][1] = 0;   
 
    cout << "spectre[" << j << "][0]=" << spectre[j][0] << endl;   
    cout << "spectre[" << j << "][1]=" << spectre[j][1] << endl;   
 
	}
 
	return ** spectre;
}
je ne vois pas ou est mon erreur...
merci pour votre aide