hello...i'm currently a third year highschool student...and i was wondering if anyone can help me on how to use arrays and utilizing them in fstreams...i'm currently doing my case study and i'm stuck since i still don't have any idea on how to use arrays...our teacher didn't teach us about them, and others just self-studied...i just don't know how to deal with arrays...can anyone help me?
re41verse 0 Newbie Poster
Recommended Answers
Jump to PostAn array is a number of objects.
Example on array:
const int array_size = 10; // const because Nick Evan says so :) float floatArray[array_size]; // this is how we make an array floatArray[0] = 4.2; // this is how we access the first element in …
Jump to Post
for(int i = 0; i < array_size-1; i++)
You lose the last element this way. Should be i<array_size, so if you have an array of size 3 you get 0,1,2
Jump to PostOh yeah, you're right, thanks for noticing.
All 9 Replies
Excizted 67 Posting Whiz
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
Excizted 67 Posting Whiz
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
Excizted 67 Posting Whiz
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
Excizted 67 Posting Whiz
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
Excizted 67 Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.