Click here to Skip to main content
15,907,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionc++ implementation of a linked list. Pin
neo2922-Jan-13 0:31
neo2922-Jan-13 0:31 
Pardon me!! I am new here. I am unable to use addNode function. When i declare Node* it doesnt compile.
I am trying to implement a linked list in c++ without
using structures and only use pure classes.I am rusty here. Any help would be great.
head->addNode() and head.addNode() doesnt work.

C++
#include<iostream>
#include<cstdlib>
using namespace std;
class Node
{
  int   data;
  Node* next;
public:
  Node()
 {
   data=0;
   next=NULL;
 }
 void addNode(int a)
{
   if(this!=NULL)
   {
     data=a;
     next=NULL;
   }
}
};
void main()
{
  Node* head;
        head.addNode(10);
}

AnswerRe: c++ implementation of a linked list. Pin
Maximilien22-Jan-13 1:35
Maximilien22-Jan-13 1:35 
AnswerRe: c++ implementation of a linked list. Pin
Sivaraman Dhamodharan22-Jan-13 2:42
Sivaraman Dhamodharan22-Jan-13 2:42 
QuestionHaving problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute21-Jan-13 23:52
Bee cute21-Jan-13 23:52 
AnswerRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Richard MacCutchan21-Jan-13 23:57
mveRichard MacCutchan21-Jan-13 23:57 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute22-Jan-13 14:36
Bee cute22-Jan-13 14:36 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
_Flaviu22-Jan-13 20:55
_Flaviu22-Jan-13 20:55 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute23-Jan-13 15:57
Bee cute23-Jan-13 15:57 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
_Flaviu23-Jan-13 20:32
_Flaviu23-Jan-13 20:32 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute23-Jan-13 23:13
Bee cute23-Jan-13 23:13 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Richard MacCutchan22-Jan-13 21:50
mveRichard MacCutchan22-Jan-13 21:50 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute23-Jan-13 16:00
Bee cute23-Jan-13 16:00 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Richard MacCutchan23-Jan-13 22:49
mveRichard MacCutchan23-Jan-13 22:49 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute23-Jan-13 23:16
Bee cute23-Jan-13 23:16 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Richard MacCutchan23-Jan-13 23:43
mveRichard MacCutchan23-Jan-13 23:43 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
_Flaviu24-Jan-13 21:01
_Flaviu24-Jan-13 21:01 
QuestionHow to Restart My Mfc Application Pin
haha_c21-Jan-13 20:51
haha_c21-Jan-13 20:51 
QuestionRe: How to Restart My Mfc Application Pin
CPallini21-Jan-13 22:07
mveCPallini21-Jan-13 22:07 
AnswerRe: How to Restart My Mfc Application Pin
chaau22-Jan-13 16:47
chaau22-Jan-13 16:47 
AnswerRe: How to Restart My Mfc Application Pin
Marius Bancila22-Jan-13 21:03
professionalMarius Bancila22-Jan-13 21:03 
Question(Wininet)How To Send Post Data In Content-Type: multipart/form-data; boundary=---------------------------1f0727f42ab069 Pin
81569011221-Jan-13 13:17
81569011221-Jan-13 13:17 
AnswerRe: (Wininet)How To Send Post Data In Content-Type: multipart/form-data; boundary=---------------------------1f0727f42ab069 Pin
pasztorpisti21-Jan-13 13:36
pasztorpisti21-Jan-13 13:36 
QuestionWait for a WMI method to return Pin
Varun Pandey21-Jan-13 0:27
Varun Pandey21-Jan-13 0:27 
QuestionHow to clean registry of MFC Pin
haha_c20-Jan-13 22:26
haha_c20-Jan-13 22:26 
AnswerRe: How to clean registry of MFC Pin
Richard MacCutchan20-Jan-13 23:05
mveRichard MacCutchan20-Jan-13 23:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.