Home > Enterprise >  Thread 1: Breakpoint 1.1(1)
Thread 1: Breakpoint 1.1(1)

Time:12-16

I'm trying to do a small project and I came over a breakpoint issue. I had it previously on char dirname[256] when I had a char holding it. However, after I removed the char it changed the breakpoint to the cout, which I never had before. I fairly new in c somewhat in-depth explanations would be nice. Thank you.

Code: 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";   }
}

CodePudding user response:

I think your problem is related to using XCode editor rather than coding. I recommend reading this article.

  • Related