TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marco
NA
59
0
allocating objects in C#
Oct 30 2007 6:20 AM
Hello, I'm a newbie C#er...
I have just one question: I'm trying to code my own linked list;
I tried to write in C# and after I'll explain my doubt:
class Node {
public Node (int v) { next = null; val =n; }
Node next;
int val;
}
class LinkedList {
LinkedList () {start=null;}
Node start;
public addNode( Node n) { if (start = null) start = n; else ......}
}
//main
LinkedList l = new LinkedList();
l.add (new Node (10));
...........................
Now: we focus on insert of first Node..... start node will take '10' but I don't initialized anywhere 'start' object. Is it right? Shouldn't be something like start = new Node () anywhere?
I hope you'll understand....
thanks...
Reply
Answers (
4
)
grid view control
How to determine whether a ListView item is a file or a folder?