Im using the Dev-Cpp compiler. Im trying to create a program like the one below...

#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <iomanip>
#include <fstream>
#include <stdlib.h>

using namespace System;
using namespace System::IO;
using namespace std;
int main() {
    string *com2;  
    wchar_t com;
    char loop;
    loop = 'a';
    while(loop = 'a') {
               cin >> com;
               if(com = 'deldir.') {
                      cout << "directory to delete: ";
                      Directory::Delete(com2, true);
cout << "Invalid Command..." << endl;
                      return 0;

It doesn't work. Do I need headers #using <mscorlib.dll> or #include <tchar.h>?
I can't figure it out, thanks in advance...

Would you elaborate a little more on what you are trying to do and what your problem is ?

It looks like you want to delete a directory. I am a little confused by the use of "string *com2" .. why don't you just use "string com2" ? And that while loop is infinite, I don't see you setting "loop" to something else to make it exit.

And it should be while (loop == 'a') NOT while (loop = 'a')

Why are you using wchar_t ? Its a single character, not a string, so if(com = 'deldir.') { isn't going to compile correctly. And deldir isn't a single character either, so it should be in double quotes like any other normal string literal in C/C++, not single quotes.

This article has been dead for over six months. Start a new discussion instead.