Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-25-2009, 02:13 PM   #1 (permalink)
 
True Techie

Join Date: Jun 2004

Posts: 125

Seraph is on a distinguished road

Default Array of Nodes? C++

I am working on a C++ project right now, and I was wondering if it is possible to make an array of Nodes.

I have created a Node class, which contains data variables:

string Element
Node* next


then it has accessors and mutators and such.

Then I am trying to create an array in another class, where each position in the array contains a pointer to a Node.

I tried doing it like this:

Node* Array[10];

and then in the constructor
for(int x=0; x<10; x++){
Array[x]=new Node();
}


That doesn't work. It gives me a fatal error.
I feel so rusty on using pointers
Seraph is offline  
Old 03-25-2009, 11:13 PM   #2 (permalink)
 
True Techie

Join Date: Jun 2004

Posts: 125

Seraph is on a distinguished road

Default Re: Array of Nodes? C++

Never mind. Very stupid oversight that is too embarrassing to share
Seraph is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Falcon Programming Language: a brief tutorial Saxon Programming Discussions 2 02-27-2009 03:43 AM
Rebuild Raid 1 Array After HD Failure Gunsmith65 Hardware Troubleshooting 9 11-14-2008 05:25 PM
Need help with setting up a RAID array TerraformScott Building, Buying, or Upgrading High Performance PC Systems 2 11-04-2008 04:45 PM
Problem with booting from SATA Raid array Big Gay Al1 Hardware Troubleshooting 0 01-22-2008 01:12 PM
Need more storage for my PC - Drive Array? CitizenCain Building, Buying, or Upgrading High Performance PC Systems 2 08-12-2007 09:53 AM