【问题标题】:Thread 1: Breakpoint 1.1(1)线程 1:断点 1.1(1)
【发布时间】:2022-01-18 23:14:14
【问题描述】:

我正在尝试做一个小项目,但遇到了断点问题。我以前在 char dirname[256] 上拥有它,当时我有一个 char 持有它。但是,在我删除 char 之后,它会将断点更改为 cout,这是我以前从未有过的。我在 c++ 中相当新,有点深入的解释会很好。谢谢。

代码:C++

//  main.cpp
//  File Creator and Sorter
//
//  Created by yared yohannes on 12/15/21.
//
#include <stdio.h>
#include <cstdio>
#include <dirent.h>
#include <iostream>
using namespace std;



int main(){
    char dirname[256];
    
    cout << "What is the name of the file: ";
    cin >> dirname;
    
    DIR *d = opendir(dirname);
    if( ! d)
    { std:: cout << "ERROR: Please provide a valid directory path.\n";   }
}

【问题讨论】:

  • @SercanSebetçi 感谢兄弟让它与您发送给我的页面一起使用。将阅读它以了解调试。

标签: c++ xcode directory breakpoints


【解决方案1】:

我认为您的问题与使用 XCode 编辑器而不是编码有关。我推荐阅读this article

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-18
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    • 2017-08-26
    • 2017-05-09
    相关资源
    最近更新 更多