c++ - 无法在c中获取当前时间

标签 c++ c eclipse datetime

我看过这个example :

#include <time.h>
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
    time_t current_time;
    char* c_time_string;

    /* Obtain current time as seconds elapsed since the Epoch. */
    current_time = time(NULL);

但是在 eclipse 中调试时我在 watch 中看到地区:

time(NULL) error evaluating

虽然我有

#include <time.h>

我该如何解决这个问题?

enter image description here

最佳答案

您的调试器不够智能,无法评估时间 (NULL),除了不要在表达式窗口中键入“time(NULL)”外,没有任何解决办法。

关于c++ - 无法在c中获取当前时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18848591/

相关文章:

c - 根据成员值获取结构

java - 如何在eclipse中从编译中排除文件夹

java - 包含用于在 Eclipse 中从其他项目进行调试的源代码

c++ - 用于通过 char 快速访问 glpyh 纹理的数据结构

c++ - 计算元素相对于相机的位置

c++ - 修改已编译的静态库

java - 从故障转储确定 Eclipse 的版本

C++ 指向不同数组的指针

c - Xlib:如何检查窗口是否最小化?

c - 谁响应内存管理用malloc()