Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 我在输出中得到线程1:信号sigbart_C++_Binary_Xcode4.2_Generator_Sequence - Fatal编程技术网

C++ 我在输出中得到线程1:信号sigbart

C++ 我在输出中得到线程1:信号sigbart,c++,binary,xcode4.2,generator,sequence,C++,Binary,Xcode4.2,Generator,Sequence,这是我的密码,请帮帮我!我正在使用xcode。。我想为一个多项式生成一个序列,这些项被异或运算,并反馈给第一个输入位,因为它是8位的,它被执行了2^8-1次。另外的代码也会很有用,提前谢谢 #include "32bit.h" #include<iostream> using namespace std; int main() { bool input[8]; int n; bool out=0; cout<<"Enter the no

这是我的密码,请帮帮我!我正在使用xcode。。我想为一个多项式生成一个序列,这些项被异或运算,并反馈给第一个输入位,因为它是8位的,它被执行了2^8-1次。另外的代码也会很有用,提前谢谢

#include "32bit.h"
#include<iostream>

using namespace std;
int main()
{
    bool input[8];
    int n;
    bool out=0;
    cout<<"Enter the no of terms ";
    cin>>n;
    int temp1[n];
    int gen=0;
    bool store[255];
    cout<<"Input power of x in increasing order, Omit x^0";


    for(int i=0;i<n;i++)
        cin>>temp1[i];
    cout<<"Enter key to generate ";
    cin>>gen;
    for(int m=0;m<255;m++)
    {
        store[m]=input[gen];
        bool temp2[n];
        int var=0;
        for(int j=0;j<n;j++)
        {

            var=temp1[j];
            temp2[j]=input[var];
        }
        int c=0;
        for(int k=0;k<n;k++)
        {
            if(temp2[k]%2==1)
                c++;

        }
        if(c%2==1)
            out=1;
        else
            out=0;
        for(int l=0;l<8;l++)
            input[l+1]=input[l];
        input[0]=out;
    }
    for(int p=0;p<255;p++)
        cout<<store[p];
}
#包括“32bit.h”
#包括
使用名称空间std;
int main()
{
布尔输入[8];
int n;
bool out=0;
coutn;
int temp1[n];
int-gen=0;
布尔商店[255];

cout这里有一个越界数组访问:

    for(int l=0;l<8;l++)
        input[l+1]=input[l];

当你在调试模式下运行这个程序时会发生什么?调试器停止在哪行?在最后一行代码中感谢,但是这没有纠正它。我有疑问……我们能做CIN > n;BoOL TEMP[n];在C++中…还是我们必须动态地做?
    for(int l=0;l<7;l++)
        input[l+1]=input[l];