Thread: arrays hard to grasp?

  1. #1
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787

    arrays hard to grasp?

    I've noticed that back in my High School programming class, we learned arrays before functions, but in all the programming classes I'm taking now in college, we're learning arrays after pointers, functions, and even objects... this doesn't make sense IMO, and I was just wondering if anybody else had any other opinions/observations/answers...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  2. #2
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    Personaly i didn't find them hard, and in my class we learned about them early on, teacher explained same time as he explained functions

  3. #3
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    I found that in college too, in my beginning programming classes. And I never found the concept to be hard at all, but there were a lot of people that REALLY struggled with it. Granted, a lot of those people weren't going into a programming related field, it was just a requirement for them to take a programming class. But yeah, there are a lot harder things than arrays.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I didn't find them hard at all, either. I also think it actually harmful to teach arrays after objects AND pointers. I can't learn something unless I know why I'm learning it, and there's really not a lot of use you have for pointers without arrays, etc... Also - if you're teaching data structures for the first time - start with something simple, like an array?

  5. #5
    Compulsive Liar Robc's Avatar
    Join Date
    Jul 2004
    Posts
    149
    I can fully understand someone teaching C++ and covering the use of functions and objects before arrays, stressing the use of the vector class. That's simply good style and it makes sense. Without a reasonable substitute though, I'm not too sure about it. Arrays (or a decent facsimile) are pretty handy even in the first days of programming.

  6. #6
    ---
    Join Date
    May 2004
    Posts
    1,379
    when it comes to understanding arrays, functions and pointers. arrays were by far the easiest for me, then functions, then pointers and that is the order i was taught in.

  7. #7
    Compulsive Liar Robc's Avatar
    Join Date
    Jul 2004
    Posts
    149
    >arrays were by far the easiest for me, then functions, then pointers and that is the order i was taught in.
    A collection of homogeneous objects is easier to follow for a beginner than a callable collection of instructions and certainly the concept of a pointer. Especially the concept of a pointer, everyone talks about their power and flexibility so much, beginners are tricked into thinking that they must be complicated and overlook the simple facts.

  8. #8
    Registered User
    Join Date
    Jun 2003
    Posts
    91
    I did at first. But i now just see arrays as a collection of individual variables, which is what they are.

    An int array of say [2] is like joining 3 variables together side by side. I'm not entirely sure of the benefits of arrays i think it must have an efficiency property to it.

  9. #9
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    instead of doing this:
    Code:
    int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
    float fa,fb,fc,fd,fe,ff,fg,fh,fi,fj,fk,fl,fm,fn,fo,fp,fq,fr,fs,ft,fu,fv,fw,fx,fy,fz;
    you can just do:
    Code:
    int i[25];
    float f[25];
    and the array version lends itself nicely to looping...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-06-2005, 07:11 PM
  2. Trinary Hard Drive
    By nickname_changed in forum Tech Board
    Replies: 14
    Last Post: 05-13-2005, 10:01 AM
  3. Help with arrays and pointers please...
    By crazyeyesz28 in forum C++ Programming
    Replies: 8
    Last Post: 03-17-2005, 01:48 PM
  4. Merging two arrays.
    By Roaring_Tiger in forum C Programming
    Replies: 2
    Last Post: 08-21-2004, 07:00 AM
  5. Help understanding arrays and pointers
    By James00 in forum C Programming
    Replies: 2
    Last Post: 05-27-2003, 01:41 AM