Answer the question
In order to leave comments, you need to log in
How to pass argument of type string or char array to function from win api?
I am using Visual Studio 2017.
Here is the code snippet:
#include "stdafx.h"
#include <iostream>
#include <string>
#include <windows.h>
#include <shellapi.h>
#include <mmsystem.h>
#pragma comment(lib, "WinMM.Lib")
using namespace std;
int main()
{
string aaa = "C:\\";
cout << (GetDriveType(aaa)==DRIVE_CDROM);
return 0;
}
char aaa[4] = "C:\\";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question