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;
}

 

posted on 2024-06-10 23:07  lydstory  阅读(43)  评论(0)    收藏  举报

导航