corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » can anyone help with some C++ stuff??? » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

corb

posted on 27th Aug 03 at 20:55

And have u got any pics of Hels install anywhere?


corb

posted on 27th Aug 03 at 20:54

What is it?


SteveW

posted on 27th Aug 03 at 20:22

:lol: you got me ;)

Cant get my head round this shite :(

Steve


m-dot

posted on 27th Aug 03 at 19:20

:| he might be


Ian

posted on 27th Aug 03 at 19:15

No he's playing with C++ for fun :lol:


m-dot

posted on 27th Aug 03 at 19:10

lol steve are you doing course work or something? right, thats it.. no more help for you :P


Richie

posted on 27th Aug 03 at 19:08

Steven stop cheating


m-dot

posted on 27th Aug 03 at 19:05

lol sorry, forgot your question: a loop is used to initialise the whole array to zero, thus even if the array size increases, the main loop code still remains the same. All that would change is the constant iSIZE.

:)


SteveW

posted on 27th Aug 03 at 18:36

Great, but why would it be necessary to do this??

Steve


neiliosxi

posted on 27th Aug 03 at 18:35

I had to learn all this at uni, 1st year on electrical engineering degree, its a nightmare if u have never heard of C++!!!


m-dot

posted on 27th Aug 03 at 18:09

tim check your mails:)


m-dot

posted on 27th Aug 03 at 18:08

bastard, tim replied quicker :(


m-dot

posted on 27th Aug 03 at 18:08

lol, you got me on the first one! but if you want to initialise an array to all zeros, initialise it with single zeros:

char cArray[100]={0};

:o:thumbs:


Tim

posted on 27th Aug 03 at 18:04

1) A definition of the array MARKS might help answer the question? If you mean the range of values, then it's just ( array size - 1 ) i.e. int marks[100] would have values 0 - 99.

2) To initialise everything to zero, just do

int marks[100] = {0};

[Edited on 27-08-2003 by Tim]


Ben

posted on 27th Aug 03 at 18:03

what is it:boggle: :lol:


Adam-D

posted on 27th Aug 03 at 17:48

fuvkin hate c++


SteveW

posted on 27th Aug 03 at 17:47

Here you are try these:

What are the allowable index values for the array MARKS???

What is necessary to initialise all elements of the array to zero???

Cheers buddy

Steve :wave:


SteveW

posted on 27th Aug 03 at 17:45

SXI07 - your a life saver, just found all that on a site myself actually. Well done, spot on matey.

Stay online for a bit, need some other bits answered as well :thumbs:

Steve


CORSA NUT

posted on 27th Aug 03 at 17:34

WTF!!!!! :lol:


m-dot

posted on 27th Aug 03 at 17:29

Declare the array arrays size and the type of elements. All elements must be the same type. Write the element type name, the name of the array variable, then the size enclosed in square brackets ("[]").

int scores[100]; --- array of 100 ints, scores[0] to scores[99]
char name[40]; --- array of 40 chars, name[0] to name[39]


You need three pieces of information to gain access to an array element:

1. The starting address of the array or base address.

2. The array element number or array index you wish to access.

3. The data type size, in bytes, of the data type stored in the array. The size of the data type, along with the index, will be used to calculate an offset into the array from the address of the first element using the following formula:

address of array element = base address + (data type size * array index)

:wave:


SteveW

posted on 27th Aug 03 at 17:04

OK heres the problem:

What 3 things need to be written to declare an array???

What 2 things need to be written to access an element of an array???

Cheers peeps.

Steve:thumbs: