8 Replies - 386 Views - Last Post: 04 October 2012 - 01:18 PM Rate Topic: -----

#1 rlima1877  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 12

Feeding an array from a text file.

Posted 03 October 2012 - 04:19 PM

Please HELP!

I have to input data from a text file into an array. I also must be able to edit this data such as remove an object, add an object, find an object etc.

For example:

ID Name Salary
923948290 Lucas Kleins 30.000
293589435 Ricardo Silva 23.000
891345013 John Reid 30.000
901394503 Jose Jack 23.000
913453498 Joe Geui 24.000

How can I input this and be able to find the indexes?

Is This A Good Question/Topic? 0
  • +

Replies To: Feeding an array from a text file.

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1184
  • View blog
  • Posts: 7,254
  • Joined: 07-September 06

Re: Feeding an array from a text file.

Posted 03 October 2012 - 04:22 PM

What code do you currently have? What have you tried? What are you stuck on (other than all of it, that doesn't count as an answer)?
Was This Post Helpful? 0
  • +
  • -

#3 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2816
  • View blog
  • Posts: 11,922
  • Joined: 20-September 08

Re: Feeding an array from a text file.

Posted 03 October 2012 - 04:24 PM

If those are your requirements, an array is not appropriate. Use a List of (say) Employee objects
Was This Post Helpful? 0
  • +
  • -

#4 rlima1877  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 12

Re: Feeding an array from a text file.

Posted 03 October 2012 - 04:30 PM

I must use arrays, I have to have an abstract class and create methods myself to accomplish these tasks. I just want an overview of how i should start.

I already have classes set up with constructors and mutator methods.
Was This Post Helpful? 0
  • +
  • -

#5 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2816
  • View blog
  • Posts: 11,922
  • Joined: 20-September 08

Re: Feeding an array from a text file.

Posted 03 October 2012 - 04:34 PM

Then create Employee[]. You can either 'remove' by setting elements to null or creating a new one and copying elements
Was This Post Helpful? 0
  • +
  • -

#6 rlima1877  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 12

Re: Feeding an array from a text file.

Posted 03 October 2012 - 05:18 PM

where is the best place to read about this topic?
Was This Post Helpful? 0
  • +
  • -

#7 rlima1877  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 12

Re: Feeding an array from a text file.

Posted 03 October 2012 - 05:28 PM

I pretty much have to create my own arraylist from using arrays which uses text file.
Was This Post Helpful? 0
  • +
  • -

#8 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2816
  • View blog
  • Posts: 11,922
  • Joined: 20-September 08

Re: Feeding an array from a text file.

Posted 04 October 2012 - 04:06 AM

Quote

I pretty much have to create my own arraylist from using arrays


Well, then you need to do what i suggested earlier and resize the array as needed. Start by making the Employee class
Was This Post Helpful? 0
  • +
  • -

#9 rlima1877  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 12

Re: Feeding an array from a text file.

Posted 04 October 2012 - 01:18 PM

ok ill try that thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1