注册 登录
编程论坛 C++教室

vs2015调试不了,错误看不懂。。

moox 发布于 2018-01-07 18:31, 2549 次点击
程序代码:
#include<iostream>
using namespace std;
/*int check(char one);
int check(char one, char two);
int numberDecode(string code)
{
    if (code[0]=='0'||code.size() == 0) return 0;
    if (code.size() == 1) return check(code[0]);
    int fn = 0, fn_1 = 0, fn_2 = 1;
    fn_1 = check(code[0])*check(code[1]) + check(code[0], code[1]);
    for (int i=2; i < code.size(); i++)
    {
        if (check(code[i])) fn += fn_1;
        if (check(code[i - 1], code[i])) fn += fn_2;
        if (fn == 0) return 0;
        fn_2 = fn_1;
        fn_1 = fn;
    }
    return fn_1;
}
int check(char one)//check the rage from 1 to 9
{
    return (one != '0') ? 1 : 0;
}
int check(char one, char two)//check the rage from 1 to 26
{
    return (one == '1' || (one == '2'&&two <= '6')) ? 1 : 0;
}
int main()
{
    string s = "24";
    cout << numberDecode(s) << endl;
    return 0;
}
*/
int main()
{
    cout << "hello world" << endl;
    return 0;
}

错误:
1>------ 已启动生成: 项目: NumberDecode, 配置: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(355,5): error MSB6006: “CL.exe”已退出,代码为 -1073741515。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
是少了什么东西吗。。代码没问题vc6上可以运行出结果的。。。
4 回复
#2
yangfrancis2018-01-09 11:37
debug目录下的东西删了再运行看行不行呢。
#3
moox2018-01-28 10:52
编程谜题?我也这个错误问题,不知道怎么解决就换codeblocks了
#4
william20112018-01-31 06:37
若使用vs ide编程环境,应当在源文件的开头处有以下一行:
#include "stdafx.h"
否则会出错。
试试看,是否解决了以上问题
#5
Jonny02012018-02-04 19:24
可以试着把原工程删了,重新建一个加入上面的代码
之前在学校的机房莫名其妙就出错,重新建一个工程就好了
1