C 树 XML 序列化

标签 c xml serialization recursion

我目前正在尝试递归循环树结构并使用(语言)C 将其序列化为字符串。当涉及到 C 时,我是一个真正的新手(来自 Java、C#、 ActionScript 背景),而且我很难掌握一般情况。

我应该使用库来帮助生成 XML 吗?如何使用 C 实现递归?

谢谢

最佳答案

Should I use a library to help generate the XML?

是的。 libxml , minixml和别的。只是谷歌了解其他人,但我会选择 libxml。

How do I implement recursion using C?

嗯,实现递归本身非常简单。例如,这是递归的:

int fact(int i)
{
    return i ? i*fact(i-1) : 1;
}

问题在于您想要变得多复杂。但对于 XML,请使用库。

关于C 树 XML 序列化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6755184/

相关文章:

xml - 从 Flash 中的 swf 文件外部加载 xml 文件

c# - 反序列化包含 List<T> : Why is List initially filled with Nulls? 的类

c# - 如何序列化从字典派生的类

c - 将文本文件的第一个和第二个单词存储到两个数组中的最佳方法

c - awk 减少对系统的依赖

c++ - 4 个 1byte char 到 1 个 4byte int?

C - Valgrind 和 "Conditional jump or move depends on uninitialised value(s)"错误

c# - 两个 XML 的比较 - "illegal characters in path"

C# Xmlserializer/XmlElement 不同的名字

java - Gson反序列化抛出转换错误