运行时结构的定义 [英] Runtime Definition of a struct

查看:99
本文介绍了运行时结构的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不认为这是可能的,但是,如果有人对某项作品发表评论

那将是很好的。让我解释一下我想这样做的原因。
这样做。假设您获得了一个文件,其中包含一个标题,该标题定义了文件中包含的一组数据的结构。如果你在阅读文件标题之前不知道
结构是什么

你将如何在代码中使用它?


任何评论都将不胜感激。

I don''t think this is possible but, if anyone has comments on a work
around that would be great. Let me explain the reason I would like to
do this. Suppose you are given a file that contains a header defining
a structure for a set of data that is contained in the file. If you do
not know what the structure is before you read the header of the file
how would you work with this in code?

Any comments would be greatly appreciated.

推荐答案


到************ @ gmail.com 在留言中写道

< 11**********************@f14g2000cwb.googlegroups .com> ...

to************@gmail.com wrote in message
<11**********************@f14g2000cwb.googlegroups .com>...
我认为这不可能但是,如果有人对作品发表评论那将是很好的。让我解释一下我想这样做的原因。


做什么?

假设您有一个文件,其中包含一个标题,该标题定义了一组数据的结构,该结构包含在文件。如果你在阅读文件的标题之前不知道结构是什么
你将如何在代码中使用它?

任何评论将不胜感激。
I don''t think this is possible but, if anyone has comments on a work
around that would be great. Let me explain the reason I would like to
do this.
Do what?
Suppose you are given a file that contains a header defining
a structure for a set of data that is contained in the file. If you do
not know what the structure is before you read the header of the file
how would you work with this in code?

Any comments would be greatly appreciated.




请仔细阅读你的帖子并用

实际想法替换所有''this''实例。

-

Bob R

POVrookie



Please go through your post and replace all instances of ''this'' with an
actual thought.

--
Bob R
POVrookie


这 - >在运行时定义一个结构(根据message.subject)


BobR写道:
This -> Define a struct at Runtime (According to message.subject)

BobR wrote:
到************ @ gmail.com 在留言中写道
< 11 ******** **************@f14g2000cwb.googlegroups .com> ...
to************@gmail.com wrote in message
<11**********************@f14g2000cwb.googlegroups .com>...
我不认为这是可能的,但是,如果有人对工作发表评论
围绕那将是伟大的。让我解释一下我想这样做的原因。
I don''t think this is possible but, if anyone has comments on a work
around that would be great. Let me explain the reason I would like to
do this.



做什么?



Do what?

假设你有一个文件,包含一个标题,用于定义文件中包含的一组数据的结构。如果你在阅读文件的标题之前不知道结构是什么
你将如何在代码中使用它?

任何评论将不胜感激。
Suppose you are given a file that contains a header defining
a structure for a set of data that is contained in the file. If you do
not know what the structure is before you read the header of the file
how would you work with this in code?

Any comments would be greatly appreciated.



请仔细阅读你的帖子并用实际的想法替换所有这个的实例。

-
鲍勃R
POVrookie



Please go through your post and replace all instances of ''this'' with an
actual thought.

--
Bob R
POVrookie






到************ @ gmail.com 写道:
我不认为这是可能的,但是,如果有人有对工作的评论
围绕这将是伟大的。让我解释一下我想这样做的原因。假设您有一个文件,其中包含一个标题,用于定义文件中包含的一组数据的结构。如果你在阅读文件的标题之前不知道结构是什么
你将如何在代码中使用它?

任何评论将不胜感激。
I don''t think this is possible but, if anyone has comments on a work
around that would be great. Let me explain the reason I would like to
do this. Suppose you are given a file that contains a header defining
a structure for a set of data that is contained in the file. If you do
not know what the structure is before you read the header of the file
how would you work with this in code?

Any comments would be greatly appreciated.



假设你知道如何处理文件中的数据类型,你可以将它b / b
读入std :: map< Type,std :: string>并根据他们的类型处理基于

的值。


Ian


Assuming you know how to process the datatypes in the file, you could
read it into a std::map<Type,std::string> and process the values based
on their type.

Ian


这篇关于运行时结构的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆