Hey guys i got another problem with this prgram. The directory is created both ways that you guys said but i am having another bigger problem. My program has 4 options, OPen a file, Create a File, Help(Irrevelvant), and Quit. The program writes the code sometimes and reads it sometimes. Sometimes i get a KERNEL32.dll error. Heres the code, maybe you guys could help:
Code:
...Creating the folder (Works fine)...
int x;
x=1;
while(x=1){
...(some menu stuff)
int choice;
cin>>choice;
cin.ignore();
if(choice==1) // Read File
{
char entryn[20];
char prevname[50];
cout<<"Entry Name: ";
cin.getline(entryn,20);
strcat (prevname, "C:/ProfilesProg/");
strcat (prevname, entryn);
ifstream entry(prevname);
cout<<"\n***File Start***\n\n";
char ch;
while(entry.get(ch)){
cout<<ch;
}
cout<<"\n\n***End of File***"\n";
cin.ignore();
entry.close();
continue;
}
else if(choice==2){ //Write a File
cout<<"Name of Entry: ";
char entrynew[20];
char entryname[50];
cin.getline(entrynew,20);
strcat (entryname, "c:/ProfilesProg/");
strcat (entryname, entrynew);
char notes[1000];
cout<<"Enter Information.\n\n";
ofstream newentry(entryname);
newentry<<notes;
newentry.close();
continue;
}
...Nothing to do with the problem
Please if you dont mind correct any mistakes that have been made and comment on the code.
Thanks so much!