preprocessor problem
#1

Hello,
i have problem with #define and replacing special characters in compile time
(from:
ě љ č ř ћ э б н й
to:
e s c r z y a i e)

in coplile time, NOT real time.

I have function PrintTest with constant string parameter

Код:
public OnFilterScriptInit()
{
	PrintTest("pбpěp");//i need rewrite to: papep
	PrintTest("pбrб");//para
	PrintTest("jeћнљ");//jezis
	PrintTest("paraљutista");//parasutista
	PrintTest("mlйko");//mleko
	PrintTest("ћбdnб");//zadna
	//etc. many use 1 000 000 times in code. Wery hard for rewriting
	return 1;
}
I try use define like this:
Код:
#define PrintTest("%0б%1")  PrintTest(#%0a#%1)

//for string "pбrб" replace "parб" NOT "para" what i need
I try use define like this:
Код:
#define PrintTest("%0ě%1")  PrintTest(#%0e#%1)
#define PrintTest("%0б%1")  PrintTest(#%0a#%1)

//for string "pбpěp" replace "papěp" NOT "papep" what i need. And in compile show error warning 201: redefinition of constant/macro (symbol "PrintTest("%0б%1")")
I try use define like this:
Код:
#define ě e

//In compile show error 074: #define pattern must start with an alphabetic character
How to write define to replace this special characters?
Thanks for any help
Reply


Messages In This Thread
preprocessor problem - by ATomas - 27.02.2017, 19:10
Re: preprocessor problem - by Runn3R - 27.02.2017, 19:24
Re: preprocessor problem - by Misiur - 27.02.2017, 19:34
Re: preprocessor problem - by ATomas - 27.02.2017, 19:54
Re: preprocessor problem - by Misiur - 27.02.2017, 20:31
Re: preprocessor problem - by ATomas - 27.02.2017, 21:10
Re: preprocessor problem - by renatog - 27.02.2017, 21:58
Re: preprocessor problem - by ATomas - 27.02.2017, 22:35
Re: preprocessor problem - by ATomas - 28.02.2017, 21:07

Forum Jump:


Users browsing this thread: 1 Guest(s)