Re: Arrays/Literal Notation
- From: "Peter Bradley" <pbradley@xxxxxxxxxx>
- Date: Wed, 21 Feb 2007 16:55:40 -0000
Well, that's a pretty good way of ensuring that no-one will help you with
your homework. Congratulations. I hope the foot gets better soon.
Just for your info, in case you should ever post to a newsgroup again
seeking help with homework, you should ensure that you do the following:
* State clearly that you are looking for help with homework
* Explain what research you have carried out, what you have already tried
and what the results were.
* Assure the group that answers will be credited to the group or individual
giving the advice and that you will not try to pass off other people's work
as your own.
That's what I did when studying for my MSc recently. I got lots of help and
I was as good as my word in terms of crediting other people when they had
helped me out. I even posted my answers so that people could check it out
for themselves. This also got me a commendation from my tutor.
Oh! and finally. Remember that students can be dismissed for plagiarism,
and that professors also read newsgroups.
Peter
"AA2e72E" <AA2e72E@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:83F12FCB-887C-490E-B1DA-7465D30703B2@xxxxxxxxxxxxxxxx
Learn to read before jumping to prescribe.
My note says that I know the rank (number of dimensions) is 3; I go on to
tell you that the dimensions are 3,1,4. The question was how would I
modify
the right hand side (RHS) such that the rank stayed as 3 but he dimensions
were 3,2,4 i.e how would I increase the second dimension to 1.
The second question was whether the RHS was a 'literal ' notation.
If you did not know, or cannot be bothered to understand what is written,
why do't you simply choose not to respond? Your answer adds nothing.
PS: I had bothered to research my own answers but came with nothing; hence
the post.
"Barry Kelly" wrote:
AA2e72E wrote:
int[, ,] array = { { { 1, 2, 3, 3 }}, { { 7, -1, 9, 0 } }, { { -1, 0,
7, 8 }
} }; // 3D
In the line of code above, am I using 'literal' syntax/notation to
create
the array?
The rank of the array is 3, its dimensions are 3,1,4.
Hint: count '3' '1' '4'. It's equal to 3.
Another hint:
* What is there 4 of in the top example?
* Given that you've gotten what there's 4 of, what is there only one of,
for its given level of nesting?
* Can you spot what there's 3 of now?
How would I change the code to produce
a. an array of dimension 3,2,4?
b. an array of rank 4?
Do you own homework - it's not hard!
-- Barry
--
http://barrkel.blogspot.com/
.
- Follow-Ups:
- Re: Arrays/Literal Notation
- From: Mark Wilden
- Re: Arrays/Literal Notation
- References:
- Re: Arrays/Literal Notation
- From: Barry Kelly
- Re: Arrays/Literal Notation
- Prev by Date: Re: Arrays/Literal Notation
- Next by Date: Re: Check to see if object instance exists
- Previous by thread: Re: Arrays/Literal Notation
- Next by thread: Re: Arrays/Literal Notation
- Index(es):
Relevant Pages
|