A [X] [Y] [Z] [英] A[x][y][z]

查看:82
本文介绍了A [X] [Y] [Z]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用多维数组在C语言中表现糟糕。


A [x] [y] [z]比A [x,y,z]差,


是从批处理文件成功运行C编译器的人,

首先将所有后面的表达式

转换为相应的前者然后编译它?


虽然我们正在使用它,但这个预处理实用程序应该更改数组定义,例如

int B [N];

到int B [N + 1];

因为B [N]不会被定义,只有B [ 0],B [1],..,B [N-1]

解决方案

st ***** @ aol.com 写道:

它在多维度的C中很糟糕阵列。


如果你这样说。

A [x] [y] [z]比A [x,y,z],$ b $差b

是吗?

是从批处理文件成功运行C编译器的人,首先将所有后面的表达式转换为相应的前者然后编译它?

虽然我们正在使用它,但这个预处理实用程序还应该改变数组定义,例如
int B [N];
进入int B [N + 1];
由于B [N]不会被定义,只有B [0],B [1],..,B [N-1]



我的建议是首先正确编写代码。

`int B [N]`定义一个N元素数组。它只是有奇怪的索引。

你可能会想 - 我当然这样做 - 基于0的索引是魔鬼的工作

,但这是C的选择,你会更好地工作(因此不会违背通常的行为,而不是那些可能帮助你的人的b $ b),而不是反对它。 />

-

克里斯我被巨魔抓住了吗? Dollin

软件工程师的歌曲:谁知道时间在哪里。


st ***** @ aol.com 写道:

它在C中的多维数组很糟糕。 / [
A [x] [y] [z]比A [x,y,z]更差,



< snip>

如果你想要Pascal,你知道从哪里得到它。


S.


" Skarmander" <在***** @ dontmailme.com>在消息中写道

news:43 *********************** @ news.xs4all.nl ...

st*****@aol.com 写道:

it''在多维数组C中很糟糕。
A [x] [y] [z]比A [x,y,z]更差,


如果你想要Pascal,你知道从哪里得到它。




也许Matlab是一个更好的尝试? :)

Alex


it''s awful in C with multi-dimension arrays.

A[x][y][z] is worse than A[x,y,z] ,

is someone successfully running the C-compiler from batch-file,
first converting all of the latter expressions
into the corresponding former ones and then compiling it ?

And while we''re at it, this preprocessing utility should
also change array definitions like e.g.
int B[N];
into int B[N+1];
since B[N] would not be defined else, only B[0],B[1],..,B[N-1]

解决方案

st*****@aol.com wrote:

it''s awful in C with multi-dimension arrays.
If you say so.
A[x][y][z] is worse than A[x,y,z] ,
Is it?
is someone successfully running the C-compiler from batch-file,
first converting all of the latter expressions
into the corresponding former ones and then compiling it ?

And while we''re at it, this preprocessing utility should
also change array definitions like e.g.
int B[N];
into int B[N+1];
since B[N] would not be defined else, only B[0],B[1],..,B[N-1]



My advice would be to write the code correctly in the first place.
`int B[N]` defines an N-element array. It just has weird indexing.
You may think - I certainly do - that 0-based indexing is the work
of the devil, but that is the choice made for C, and you''re better
off working with it (and hence not contrary to the usual behaviour
of those here who might help you) than against it.

--
Chris "am I troll-caught?" Dollin
The software engineer''s song: "who knows where the time goes".


st*****@aol.com wrote:

it''s awful in C with multi-dimension arrays.

A[x][y][z] is worse than A[x,y,z] ,


<snip>
If you want Pascal, you know where to get it.

S.


"Skarmander" <in*****@dontmailme.com> wrote in message
news:43***********************@news.xs4all.nl...

st*****@aol.com wrote:

it''s awful in C with multi-dimension arrays.
A[x][y][z] is worse than A[x,y,z] ,


If you want Pascal, you know where to get it.



Maybe Matlab is a better try? :)
Alex


这篇关于A [X] [Y] [Z]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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