问题描述
大家好日子,
i希望创建一个代表数据的数组,必须将
转移到pdf doc(iTextSharp)。 />
问题是,我的信仰似乎太宽松了。也就是说,(我有
c / c ++,perl和我在c#中的经验),我没有成功创造一个
多维数组。我没有在c#中创建
多维数组的经验。整个过程看起来对我来说太丑了,
我真的好了b $ b想到把所有的c#和java东西都扔到风中以便
再次使用旧的c或c ++。
或者......也许我太傻了。
所以,如果那里的某个程序员想要从他的萧条中吸取另一个深刻的程序员,那么
下面的代码有什么问题:( !!!!
使用系统;
命名空间arraytest {
class Class1 {
[STAThread]
static void Main(string [] args){
//不应该是以下语句创建一个三维数组
?
数组编号= Array.CreateInstance(typeof(Int32),10,4,2
);
//为什么不可能简单地做:
// numbers [] [] [] = new int [10] [4] [2]?!
尝试{
for(int i = 0; i< 10; i ++){
for(int y = 0; y < 4; i ++){
for(int j = 0; j< 2; j ++){
//请不要回答:你为什么不这样做
numbers.initialize()
//无言!
numbers.SetValue(100,i,y,j);
}
}
}
} catch(例外e){
System.Console.WriteLine(e.ToString());
System.Console.Read();
}
}
}
}
当然,我可以创建一个行类,它可以保存
数据和
将这些行对象放入一个数组中。但是我不想要不要给我的客户的工作站支付宝贵的费用。
请帮助我在这里......!
在此先感谢,Ole。
PS(对所有java程序员:你如何管理数组
是这样的并发症吗?我在java中看到类似丑陋的东西。)
if(noone.HelpsMe()){
throw新语言(进入大海);
}否则{
将System.Out&&和goto床;
}
床:
Goodday everybody,
i want to create an array that represents data, that has to
be transferred to a pdf doc ( iTextSharp ).
The problem is, that i seem too loose my faith. Namely, ( i have
experiences in
c/c++, perl and i thouht in c#, too ), i do not succeed in creating a
multidimensional array. I have no experience in creating
multidimensional array in c#. The whole process looks so ugly to me,
that i really
think of throwing all that c# and java stuff against the wind in order
to
use good old c or c++ again.
Or, ... perhaps i''m too stupid.
So, if some programmer out there would like to draw another, deep
fallen programmer out of his depressions, what is wrong with the
following code: (???!!!)
using System;
namespace arraytest {
class Class1 {
[STAThread]
static void Main( string[] args ) {
// shouldn''t the following statement create an 3-dimensional array
?
Array numbers = Array.CreateInstance( typeof ( Int32 ), 10, 4, 2
);
// and why isn''t possible simply to do :
// numbers[][][] = new int[10][4][2] ?!
try {
for( int i = 0; i < 10; i++ ) {
for ( int y = 0; y < 4; i++ ) {
for( int j = 0; j < 2; j++ ) {
// please do not answer : "why do you not do
numbers.initialize ( )
// wordless!
numbers.SetValue( 100, i,y,j );
}
}
}
}catch ( Exception e ) {
System.Console.WriteLine( e.ToString ( ) );
System.Console.Read( );
}
}
}
}
Sure, i could create a row - class, that would be able to hold the
data and
put those row objects into an array. But i don''t want''t to
overobjectize
my clients'' workstations!!
Please help me out here ...!
Thanks in advance, Ole.
PS ( to all the java programmers : how do you manage array
complications like this ? I saw something similar ugly in java . )
if ( noone.HelpsMe( ) ) {
throw new Languages ( "into the sea" );
}else {
put the System.Out && and goto bed;
}
bed:
推荐答案
-
那里是10种人。理解二元的人和那些没有b $ b的人。
(拉针回复)
http://www.programmersheaven.com/2/Les_CSharp_8_p1
--
There are 10 kinds of people. Thos who understand binary and those who
don''t.
http://code.acadx.com
(Pull the pin to reply)
这篇关于多维数组地狱 - C#与Java => C ++ ???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!