最近自学C++,用的VS2012,碰到几个问题
一个是VS2012怎么检查错误啊,好像错了就出来个命令窗,报告无法生成,但是不会像DEVC++一样说是什么错
还有一个是std::cin >> i这条命令的值是什么呢。如果int i,或_Bool i;
再i=(std::cin >> i);i的值是多少,还是会报错呢,如果char i呢;
最后就是只是我写的一个小程序
#include <iostream>
int main()
{
int amount=0, total_amount=0, value;
while(std::cin >> value){
if(value<0) amount++;
total_amount++;
}
std::cout << "the total amount of number u input is " << total_amount << "\n"
<< "and the amount of negative number is " << amount <<std::endl;
char print;
std::cin >> print;
std::cin >> print;
}
输入流 4回车5回车-4回车a回车,直接控制台就关闭了,这是为什么呢
本人初学C++,很多都不懂,还希望吧里各位大神解答一下,谢谢了
一个是VS2012怎么检查错误啊,好像错了就出来个命令窗,报告无法生成,但是不会像DEVC++一样说是什么错
还有一个是std::cin >> i这条命令的值是什么呢。如果int i,或_Bool i;
再i=(std::cin >> i);i的值是多少,还是会报错呢,如果char i呢;
最后就是只是我写的一个小程序
#include <iostream>
int main()
{
int amount=0, total_amount=0, value;
while(std::cin >> value){
if(value<0) amount++;
total_amount++;
}
std::cout << "the total amount of number u input is " << total_amount << "\n"
<< "and the amount of negative number is " << amount <<std::endl;
char print;
std::cin >> print;
std::cin >> print;
}
输入流 4回车5回车-4回车a回车,直接控制台就关闭了,这是为什么呢
本人初学C++,很多都不懂,还希望吧里各位大神解答一下,谢谢了