小编Tou*_*mam的帖子

如果我们在打印int时使用%p而不是%d会发生什么

有人可以解释第二行的输出吗?

int x=10;
printf("%d\n",x);
printf("%p\n",x);
printf("%p\n",&x);
Run Code Online (Sandbox Code Playgroud)

输出:

10
0000000a
006aff0c
Run Code Online (Sandbox Code Playgroud)

c int pointers

0
推荐指数
1
解决办法
145
查看次数

如何为C ++ 14 / C ++ 17设置VS代码

我试图从工作区中运行一个.cpp文件,但是给了我关于不添加c ++ 11 / higher标志的错误,但是我将它们添加到task.json中

错误

[Running] cd "c:\Users\Nuhash\Desktop\test\" && g++ main.cpp -o main && "c:\Users\Nuhash\Desktop\test\"main
main.cpp:8:1: error: expected unqualified-id before 'using'
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
^
main.cpp:10:1: error: expected unqualified-id before 'using'
using ordered_set_rev = tree<T, null_type, greater<T>, rb_tree_tag, tree_order_statistics_node_update>;
^
main.cpp:12:1: error: expected unqualified-id before 'using'
using dijkstra = priority_queue<T, vector<T>, greater<T>>;
^
main.cpp:62:31: warning: variadic templates only available with -std=c++11 or -std=gnu++11
template <typename T, typename... Args>
                               ^
main.cpp:63:52: warning: variadic templates only …
Run Code Online (Sandbox Code Playgroud)

c++ visual-studio-code vscode-settings vscode-tasks

0
推荐指数
2
解决办法
1921
查看次数