gpt4 book ai didi

.net - 智能感知 : no operator >> matches these operands

转载 作者:太空狗 更新时间:2023-10-29 21:07:06 27 4
gpt4 key购买 nike

我想弄清楚为什么我总是收到编译器错误

IntelliSense:没有运算符“>>”匹配这些操作数

使用下面的代码。将不胜感激任何帮助。谢谢

#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;

int main(void)
{
int n;//number of resources we will be dealing with
cout <<"What is number of resources to be shared?"<<
cin >> n;
return 0;
}

最佳答案

提示:

cout <<"What is number of resources to be shared?"<<
cin >> n;

等同于:

cout <<"What is number of resources to be shared?"<< cin >> n;

也许 <<后面应该跟类似 std::endl; 的东西, 只是或更改为 ; .

关于.net - 智能感知 : no operator >> matches these operands,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5918024/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com