How to read configuration/properties file in C?

2019-08-04 07:32发布

I have a .properties file having key value pairs like -

RegisterAE_OriginHeader = C
RegisterAE_ContentTypeHeader = application/json;ty=2
RegisterAE_RequestIdentifierHeader = /var1/R0
RegisterAE_AppendServicePathInURL = /R0
RegisterAE_ResultContent = 0

Now what is the efficient way of getting values of different data type (e.g. char*, integer separately) from this properties file in a c program?

I can parse using lex/yacc to identify char*/integer?

how can they be used in a c program?

I do not know which key will correspond to char*, and which one to integer.

0条回答
登录 后发表回答