小编jin*_*dan的帖子

#define 的“声明未声明任何内容”错误

我试图定义lllong long. 但是,这没有编译并引发错误。

我在 Windows 机器上使用 VS Code。我也在使用 gcc 8.2.0 版。

这是代码 -

#include <bits/stdc++.h>

using namespace std;

#define ll long long int;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t;

    cin >> t;

    return 0;
}

Run Code Online (Sandbox Code Playgroud)

在编译这个时,我收到了这个错误 -

test.cpp: In function 'int main()':
test.cpp:5:22: error: declaration does not declare anything [-fpermissive]
 #define ll long long int;
                      ^~~
test.cpp:12:5: note: in expansion of macro 'll'
     ll t;
     ^~
test.cpp:12:8: error: 't' was not declared in this scope …
Run Code Online (Sandbox Code Playgroud)

c++ macros compiler-errors g++ c++14

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

标签 统计

c++ ×1

c++14 ×1

compiler-errors ×1

g++ ×1

macros ×1