16x16Matrix [英] 16x16Matrix
问题描述
你好,
我得到了16个双字符列表(AU,AG,UC ......)元素,现在我想要创建一个16x16-Matrix,其中包含
列和行的列表元素。
所以我需要知道:我如何创建这样的列表,如何访问每个
元素并使用它来创建矩阵?
谢谢你的帮助
德语
Hello there,
i got a list of 16 "two-character" (AU,AG,UC...) elements, and now i
want to create a 16x16-Matrix with the elements of this list for the
columns and rows.
So i need to know: How can i create such a list, how can i access each
element and use this to create the matrix?
Thank you for your help
German
推荐答案
Gr ********* @ aol.com 写道:
Gr*********@aol.com wrote:
我得到了一个16个双字符的列表(AU,AG,UC ......)元素,现在我想用
列和行创建一个带有此列表元素的16x16-Matrix。
所以我需要知道:我如何创建这样的列表,如何访问每个
元素并使用它来创建矩阵?
所以你有多远?你可以存储几个像这样的字符: -
char元素[2];
你的问题数组是什么?还是2D阵列还是什么?你有没有检查过
你的教科书?
谢谢你的帮助
没问题
- -
Nick Keighley
****任何人都可以找到错误
i got a list of 16 "two-character" (AU,AG,UC...) elements, and now i
want to create a 16x16-Matrix with the elements of this list for the
columns and rows.
So i need to know: How can i create such a list, how can i access each
element and use this to create the matrix?
so how far have you got? You could store a couple of chars like this:-
char element [2];
So is your problem arrays? Or 2d arrays or what? Have you checked
your textbook?
Thank you for your help
no problem
--
Nick Keighley
****Can anyone find the error
是:
第0行出错:懒惰的程序员。
(comp.lang.c ++)
Yes:
Error on line 0: Lazy programmer.
(comp.lang.c++)
>所以你有多远?你可以存储这样的几个字符: -
char元素[2];
我想我可以这样做,但我必须做16个元素,
我希望有一种方法可以使用一种循环,比如TCL / TK
2d数组应该是没问题
i检查了我的书,我发现的唯一例子是:
char name [] = {'s'', ''a'',''m'',''\ 0''};
但是当我尝试用2个字符做这个时,我收到了一条警告信息
>so how far have you got? You could store a couple of chars like this:-
char element [2];
I think i could do it like this, but i have to do it for 16 elements,
and i hoped there is a way to use a kind of loop, like in TCL/TK
the 2d array should be no problem
i checked my book, and the only example i found was:
char name[]={''s'', ''a'', ''m'', ''\0''};
but when I try to do like this with 2 characters i got a warning message
Gr ******** *@aol.com 写道:
请在帖子中留下更多背景信息。
Gr*********@aol.com wrote:
please leave more context in your post.
你有多远?你可以存储几个像这样的字符: - char元素[2];
我想我可以这样做,但我必须为16个元素做,
so how far have you got? You could store a couple of chars like this:- char element [2];
I think i could do it like this, but i have to do it for 16 elements,
我以为你想要16x16?
我希望有一种方法可以使用一种循环,比如在TCL / TK
>
a循环做什么?
2d阵列应该没问题
ok,发布你可以做的代码
i检查了我的书,我发现的唯一例子是:
char name [] = {'s'','''',''''','' \\ 0''};
但是当我尝试用2个字符做这个时我得到了一条警告信息
I thought you wanted 16x16?
and i hoped there is a way to use a kind of loop, like in TCL/TK
a loop to do what?
the 2d array should be no problem
ok, post the code you can do
i checked my book, and the only example i found was:
char name[]={''s'', ''a'', ''m'', ''\0''};
but when I try to do like this with 2 characters i got a warning message
所以你想要初始化矩阵?如你所知,这可以用
chars。
你可以用字符串做类似的技巧。
char * names [] = {" aa"," ab"," ac"};
我正试图避免解决您的实际问题,因为我怀疑它是
作业。
分解为步骤。首先定义你的矩阵然后担心
初始化它。
-
Nick Keighley
so you want to initialise the matrix? As you suggest this works with
chars.
You can do a similar trick with strings.
char *names [] = {"aa", "ab", "ac"};
I''m trying to avoid solving your actual problem as I suspect its
homework.
Break it down into steps. First define your matrix then worry about
initialising it.
--
Nick Keighley
这篇关于16x16Matrix的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!