【发布时间】: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