小编Hin*_*rry的帖子

c ++错误c2015:常量中的字符太多

对不起,如果它很简单,但我是C++的新手并没有真正掌握它.我需要构建一个计算器,其唯一的命名变量是指针,这是我到目前为止,但我不断得到错误,我无法弄清楚为什么.但是,每个错误总是与我的if构造有关.

int main()
{
    //Creating variables

    //Values to perform operations on
    float *aptr = new(nothrow)float;
    float *bptr = new(nothrow)float;
    float *ansptr = new(nothrow)float;
    int *endptr = new(nothrow)int;
    char *operationptr = new(nothrow)char;

    cout << "Simple Operation Calculator" << endl; //Displays program name
    cout  << "Performs +, -, *, or / on any two real operands." << endl; //Describes nature of program to user

    *endptr = 1;
    while(*endptr = 1) //Creates a loop so that the user may perform as many operations …
Run Code Online (Sandbox Code Playgroud)

c++

-1
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×1