为什么我的 xCode 编译器输出"lldb"?
Why did my xCode compiler output "lldb"?
int x = 1;
int main()
{
int N = 20;
for (int i=1;i<=N;i++){
float h = pow(10,-i);
cout << h << endl;
cout << r=(sqrt(x+h)-sqrt(x))/h;
}
cout << 1/sqrt(2*x) << endl;
}
我有一个应该输出数字的程序,例如:
0.1, 0.01, 0.001, etc
但它输出的只是
lldb
lldb是什么意思?
我猜你可能正在使用Xcode在Mac上运行这个程序,因为lldb
是这种设置的默认调试器。
如果是这种情况,只需键入"run",看看会发生什么。 如果您是初学者,设置命令行环境来构建和运行程序可能会有更好的运气。
代码本身是正确的,这可能意味着您无法在您的环境中正确运行它。我已经复制了您的函数,它就像一个魅力:
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
int N = 20;
for (int i=1;i<=N;i++){
double h = pow(10,-i);
cout << h << endl;
}
}
使用控制台编译它
$ g++ file.cpp
$ ./a.out
0.1
0.01
0.001
0.0001
1e-05
1e-06
1e-07
1e-08
1e-09
1e-10
1e-11
1e-12
1e-13
1e-14
1e-15
1e-16
1e-17
1e-18
1e-19
1e-20
相关文章:
- 递归函数计算序列中的平方和(并输出过程)
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 请解释"函数1(p1,p2,p3);"的输出
- C++:将控制台输出存储在宏中更好吗
- 创建一个函数以在输入为负数或零时输出字符串.第一次执行用户定义的函数
- 如何在OMNET++中指定与命令行参数组合的输出文件名
- 为什么我的代码在输出中增加了93天
- 如何从void函数输出字符串
- 输入到文件并输出到另一个文件,并将流文件传递给函数
- AES加密到解密未正确输出
- 如何将c++程序的一些输出传递给shell,以便在shell中使用
- 使用C++程序合并排序没有得到正确的输出
- 为什么我不能在不创建字符串变量的情况下使用函数的字符串输出
- C++格式化输出问题
- 将值从二维数组输出到文本文件
- 集合上的输出迭代器:assign和increment迭代器
- 在while循环中输入带有std::cin的字符串后,控制台会输出大量胡言乱语
- 在集成终端上运行vscode lldb调试器时,如何获取程序的输出?
- XCode调试器lldb中断,没有错误输出,但程序运行良好
- 为什么我的 xCode 编译器输出"lldb"?