Visual c++ C2260未声明的标识符

Visual c++ C2260未声明的标识符,visual-c++,Visual C++,我收到错误消息,未声明的标识符有什么帮助吗?我已经尝试了很多东西,我相信这很简单 男孩,它确实向我询问了很多细节,我希望我能向每个人解释清楚 #include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; // Declare constants void input(int&hrs, int&mins

我收到错误消息,未声明的标识符有什么帮助吗?我已经尝试了很多东西,我相信这很简单

男孩,它确实向我询问了很多细节,我希望我能向每个人解释清楚

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>


using namespace std;

// Declare constants
void input(int&hrs, int&mins, int&amOrPm);
int covert(int hrs, int amOrPm);
void outputStime(int hrs, int mins,int amOrPm);
void outputMtime(int hrs, int mins);

 int main()
{
// Declare variables below here
int hrs = 0, mins = 0, amOrPm = 0;
char choice;

cout << setiosflags(ios::fixed | ios::showpoint);

do 
{
    input (hrs, mins, amOrPm);
    covert(hrs, amOrpm);
    outputStime (hrs, mins, amOrPm);
    outputMtime (hrs,mins);

} while (choice != 'q' && choice != 'Q');

return 0;
}

void input(int&hrs, int&mins, int&amOrPm)
{
cout << "Enter The Hour: ";
cin >> hrs;

cout << "Enter The Minutes: ";
cin >> mins;

cout << "Enter 1 AM or 2 for PM: ";
cin >> amOrPm;

}

int convert(int hrs, int amOrPm)
{

    while (amOrPm = 2)
    {
        if (hrs >= 1)
        {
            hrs = hrs + 12;
            return hrs;
        }
        else
        {
            return hrs;
        }
    }
    while (amOrPm = 1)
    {
        if (hrs <= 11)
        {
            return hrs;
        }
        else
        {
            hrs = hrs - 12;

            return hrs;
        }
    }
}

 void outputStime(int hrs, int mins, int amOrPm)
{
    cout << " Standard time is: " << hrs << ":" << mins << amOrPm <<    endl;
}

void outputMtime(int hrs, int mins, int amOrPm)
{
    cout << " Standard time is: " << hrs << ":" << mins << endl;
}
#包括
#包括
#包括
#包括
使用名称空间std;
//声明常量
无效输入(整数和小时、整数和分钟、整数和分钟);
内部隐蔽(内部时间、内部时间和内部时间);
无效输出时间(整数小时、整数分钟、整数分钟);
无效输出时间(整数小时,整数分钟);
int main()
{
//在下面声明变量
整小时=0,分钟=0,下午=0;
字符选择;
库特小时;
cout>min;
cout>pm;
}
整数转换(整数小时,整数分)
{
while(pm=2)
{
如果(小时数>=1)
{
小时数=小时数+12;
返回小时数;
}
其他的
{
返回小时数;
}
}
while(pm=1)
{
若(小时)
应该是

convert(hrs, amOrPm);
while (amOrPm == 2)
while (amOrPm == 1)
int convert(int hrs, int amOrPm);
而且

应该是

convert(hrs, amOrPm);
while (amOrPm == 2)
while (amOrPm == 1)
int convert(int hrs, int amOrPm);
一个等号表示赋值,您将amOrPm设置为2或1。两个等号(=)表示比较,您将amOrPm设置为2或1

应该是

convert(hrs, amOrPm);
while (amOrPm == 2)
while (amOrPm == 1)
int convert(int hrs, int amOrPm);
以匹配程序末尾的功能实现

应该是

convert(hrs, amOrPm);
while (amOrPm == 2)
while (amOrPm == 1)
int convert(int hrs, int amOrPm);
而且

应该是

convert(hrs, amOrPm);
while (amOrPm == 2)
while (amOrPm == 1)
int convert(int hrs, int amOrPm);
一个等号表示赋值,您将amOrPm设置为2或1。两个等号(=)表示比较,您将amOrPm设置为2或1

应该是

convert(hrs, amOrPm);
while (amOrPm == 2)
while (amOrPm == 1)
int convert(int hrs, int amOrPm);

为了匹配程序结束时的函数实现。

谢谢,我做了这些更改,因为您是正确的,但它仍然说了同样的话:(您是否将amOrpm更改为amOrpm?我刚刚做了一个测试,它将错误更改为1个未解决的外部错误LNK1120 COSC 1010未解决的外部符号“void”\u cdecl outputMtime(int,int)“(?输出时间@@YAXHH@Z)函数中引用了_mainerror LNK2019 COSC 1010修复了该错误,现在我必须弄清楚它为什么不能转换和显示OutputTime函数的军事时间:谢谢,我做了这些更改,因为你是正确的,但它仍然说了同样的话:(您是否将amOrpm更改为amOrpm?我刚刚做了一个测试,现在它将错误更改为1个未解决的外部错误LNK1120 COSC 1010未解决的外部符号“void\uu cdecl outputMtime(int,int)”(?outputMtime@@YAXHH@Z)函数中引用的_mainerror LNK2019 COSC 1010修复了该错误,现在我必须弄清楚它为什么不能转换并显示OutputTime函数的军事时间:cout