// First_VB_Prog.cpp : Defines the entry point for the console application.
//
#include <iostream>
usingnamespace std;
//Simple Linked List composing of a "Body" , "Head" and a "Tail"
struct nodeType
{
int info;
int info_2;
nodeType *link;
};
class linkedList
{
public:
linkedList()
{
Head = NULL;
}
nodeType* addHead()
{
Head = new nodeType;
return Head;
}
private:
nodeType *Head;
};
int main()
{
//declaring Nodes:
nodeType *Body;
Body = new nodeType;
nodeType *Tail;
Tail = new nodeType;
int num;
//Linking Nodes
linkedList listt;
Body->info = num; //accessing info on Body Node
listt.addHead()->link = Body; //linking OR joing the head to the body Node
Body->link = Tail; //linking OR joing the body to the TailNode
Tail->info = num; //accessing info on Tail Node
cout<<Body->info;
}
The number after my nick means how many posts i've written up until this moment (In fact, my nick is just "EssGeEich").
Right now, it should be higher than the last time you checked.
You, too, have a number right there, which means how many posts you've written.
Anyways, it's not a big problem, I just needed a fast look to see you had nothing initialized to a specific number (besides the pointers).