c中读取文本行的问题
青稞 2007-01-09 09:20:05 现在有一个文件:内容如下:
<config>
[Func_Name] = mt_Alloc
[Input_Para_Number] = 6
<Param1>
[Nameflg] = 0
[Type] = MT_WORK
[Pointer] = 1
[Input] = 1;
</Param1>
<Param2>
[Nameflg] = 1
[Type] = MT_WORK
[Pointer] = 0
[Input] = 1
</Param2>
<Param3>
[Nameflg] = 2
[Type] = MT_INT32
[Pointer] = 0
[Input] = 1
</Param3>
<Param4>
[Nameflg] = 3
[Type] = MT_WORK
[Pointer] = 0
[Input] = 1
</Param4>
<Param5>
[Nameflg] = 4
[Type] = MT_RESULT
[Pointer] = 1
[Input] = 1
</Param5>
<Param6>
[Nameflg] = 5
[Type] = MT_WORK
[Pointer] = 1
[Input] = 0
</Param6>
</config>
<case:1-1-1>
[ppwork] = 1
[buf] = 1
[analyze_width] = 656
[analyze_height] = 528
[result] = 1
[work] = 1
[/work]
<nresult>
[nret_val] = 0
<eret_val>
[eret_flg] = 0
[eret_name] = null
[eret_type] = null
[eret_val] = 0
</eret_val>
</nresult>
</case:1-1-1>
其中有许多的case,这里只列举一个,请问如何从该文件中读出‘ppwork‘,‘buf’,'analyze_width','analyze_height',注意,不是读这些变量的值,而是读它们的名字就可以了。如:[ppwork] = 1,只要读出'ppwork'就好了。。