2.1.2.13 is_good_C_identifier_ex


Description

Test if given string is a valid C or LabTalk compatible string to define a variable

Syntax

BOOL is_good_C_identifier_ex( LPCSTR lpcsz, LPCSTR lpcszExtraAllowedChars )

Parameters

lpcsz
[input] string to test
lpcszExtraAllowedChars
[input] a char set of additional characters to allow, which might not be allowed in C

Return

True if the string is a valid string to define a variable ,False if not.

Examples

EX1

void is_good_C_identifier_ex_ex1()
{
  	string str = "ab*c#";
	string strAllow = "*#";
	//change strAllow to other char set to see different result 
	bool bRet = is_good_C_identifier_ex(str , strAllow);
	if(bRet)
	printf("\"%s\" is a good identifier with allow char set \"%s\"\n" ,
             str,strAllow);
	else 
	printf("\"%s\" is not a good identifier with allow char set \"%s\" \n" ,
            str ,strAllow);
}

Remark

See Also

is_good_C_identifier

Header to Include

origin.h

Reference