I am new to c++ (Visual C++ 6.0) and I am having some trouble getting this code to work properly. I come from a very different style of coding which is nothing like c or c++. Please help me get this code working properly. This is not for a project or program I am just trying to ensure I know what I am doing before I actually write a usefull program (long ways away I know)
Here is the code that I would like to execute:
#include <windows.h>
#include <stdio.h>
#include <iostream.h>
#include <String>
using namespace std;
int test();
bool PathExists(char pathtocheck[50]);
int test()
{
char i;
for (i='A'; i='Z'; i++)
{
if(GetDriveType(i) == DRIVE_FIXED)
{
if (PathExists(i && ":\\FOLDER PATH") == 1)
{
//do something if true
//not concerned about this code
}
}
}
return 0;
}
And here are the error messages
Compiling...
EraseTest.cpp
...\EraseTest.cpp(69) : error C2664: 'GetDriveTypeA' : cannot convert parameter 1 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
...\EraseTest.cpp(71) : error C2664: 'PathExists' : cannot convert parameter 1 from 'bool' to 'char []'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.