c++ char*作为函数参数
#include "stdafx.h"
#include <iostream>
using namespace std;
bool uc_is_usb(char *devid)
{
return strlen(devid) > 3 && devid[0] == 'U' && devid[1] == 'S' && devid[2] == 'B';
}
int _tmain(int argc, _TCHAR* argv[])
{
char ausb[5] = "USB_";
if (uc_is_usb(ausb))
std::cout << "hello,world" << std::endl;
system("PAUSE");
return 0;
}
浙公网安备 33010602011771号