C++ 由于函数C+;的原因,尝试编译函数时出错+;

C++ 由于函数C+;的原因,尝试编译函数时出错+;,c++,arrays,c++11,C++,Arrays,C++11,当我试图编译这个函数时,我不知道该怎么做,我是否会一直遇到这个错误 [brgod@lisapa06]$g++-std=c++11-o letters.cpp /tmp/ccyzLa31.o:在函数main'中: 字母.cpp:(.text+0x21e) 未定义对搜索(int*,int,int)'集合2的引用:错误:ld 返回1退出状态 #include//(通常格式正确,过账时出错) #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 无效搜索(int ab[],使用的int

当我试图编译这个函数时,我不知道该怎么做,我是否会一直遇到这个错误

[brgod@lisapa06]$g++-std=c++11-o letters.cpp /tmp/ccyzLa31.o:在函数main'中:

字母.cpp:(.text+0x21e)

未定义对
搜索(int*,int,int)
'集合2的引用:错误:ld 返回1退出状态

#include//(通常格式正确,过账时出错)
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
无效搜索(int ab[],使用的int编号,int目标);
使用名称空间std;
细流ss;
int main()
{
INTA=97;
int b=98;
int c=99;
int d=100;
int e=101;
int f=102;
int g=103;
int h=104;
int i=105;
int j=106;
int k=107;
int l=108;
int m=109;
int n=110;
INTO=111;
int p=112;
int q=113;
int r=114;
int s=115;
int t=116;
INTU=117;
int v=118;
int w=119;
int x=120;
int y=121;
int z=122;
字符数_1[432];
cout>number_1;
长xb;
xb=strlen(数字1);
长ci=0;
int bruh[xb];
用于(长bi=0;bi0)
{
}
}

函数的第一个参数
搜索
在函数定义的预声明中不是
常量。

我试过编辑你的代码,但它太乱了。请编辑你的问题,直接从编辑器中复制粘贴代码,作为纯文本,然后通过
{}缩进
按钮。由于某些原因,我没有看到你的答案,并发布了我的答案,基本上重复了你的答案(现已删除),+1
#include <iostream> //(Normally formatted correctly running into error when posting
#include <cmath>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream> 
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm> 

void search(int ab[], int number_used, int target);
using namespace std;
stringstream ss;
int main()
{
    int a=97;
    int b=98;
    int c=99;
    int d=100;
    int e=101;
    int f=102;
    int g=103;
    int h=104;
    int i=105;
    int j=106;
    int k=107;
    int l=108;
    int m=109;
    int n=110;
    int o=111;
    int p=112;
    int q=113;
    int r=114;
    int s=115;   
    int t=116;
    int u=117;
    int v=118;
    int w=119;
    int x=120;
    int y=121;
    int z=122;
    char number_1[432];
    cout << "Enter text:\n";
    cin >> number_1;
    long xb;
    xb=strlen(number_1);
    long ci=0;
    int bruh[xb];
    for (long bi=0; bi<xb; bi++)
    {
        bruh[bi]=number_1[bi];
    }
    sort(bruh, bruh+xb);
    search(bruh,xb,a);
}

void search(const int ab[], int number_used, int target)
{
    int a=97;
    int b=98;
    int c=99;
    int d=100;
    int e=101;
    int f=102;
    int g=103;
    int h=104;
    int i=105;
    int j=106;
    int k=107;
    int l=108;
    int m=109;
    int n=110;
    int o=111;
    int p=112;
    int q=113;
    int r=114;
    int s=115;
    int t=116;
    int u=117;
    int v=118;
    int w=119;
    int x=120;
    int y=121;
    int z=122;
    int index=0;
    int count=0;
    bool found=false;
    while ((!found) && (index < number_used))
    {   
        if(target==ab[index])
        {
            found=true;
            count++;
            index++;
        }
        else
        {
        index++;
        }
    }
    if (count>0)
    {

    }
}