这是C++从 'const int的*' 到 'INT' 无效转换
[错误]从 'const int的*' 到 'INT'[-fpermissive]
void boite(int ligne,int colonne,int i,int s[],int k)
{
int n;
n= s_boite[i][ligne][colonne]; // i numero de la boite
for(;n!=0;n/=2)
s[k--]=n%2;
}
多个添加无效的转换:s_boit
static const int s_boite[8][4][16] = { { {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7}, { 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8}, { 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0}, {15, 12, 8, 2, 4, 9, 1, 7, 5, ...ext
调用这个函数:
for(i=0;i<8;i++) // appeller les boittes
{
ligne = resultat[i][0]*2 + resultat[i][5]; // le 1er et le dernier bit converit a au decimal
for(j=0;j<4;j++) // 4 bits du milieu
{colonne += resultat[i][j+1]*puiss(2,(3-j));}//acumulation en calculant la colone (traduction en decimal)
boite(ligne,colonne,i,mat,(4*(i+1)-1)); //mat pour sauvgarder le resultat
}
如何在哪里定义s_boite? – lurker
更多信息请..... – haccks
static const int s_boite [8] [4] [16] = { { {{{1,4,4,3,13,1,2,15,11,8,3,10, 6,12,5,9,0,7}, {0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8}, { 4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0}, {15,12,8,2,4,9,1,7 ,5,... ext – mohdows