Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ReadFile Pin
Michael Dunn1-Mar-03 6:29
sitebuilderMichael Dunn1-Mar-03 6:29 
GeneralRe: ReadFile Pin
Mike Nordell17-Mar-03 7:04
Mike Nordell17-Mar-03 7:04 
Generalusing .NET .dll in c++ / mfc Pin
red2k28-Feb-03 23:05
red2k28-Feb-03 23:05 
GeneralRe: using .NET .dll in c++ / mfc Pin
Stephane Rodriguez.28-Feb-03 23:48
Stephane Rodriguez.28-Feb-03 23:48 
GeneralHelp please!! Pin
adsilva28-Feb-03 21:24
adsilva28-Feb-03 21:24 
GeneralImage Play Pin
satyavasu28-Feb-03 20:03
satyavasu28-Feb-03 20:03 
GeneralLinked list implementation Pin
yashraj28-Feb-03 19:23
yashraj28-Feb-03 19:23 
GeneralRe: Linked list implementation Pin
Chris Richardson28-Feb-03 19:54
Chris Richardson28-Feb-03 19:54 
Alright, I was going to respond with a smartass answer, but I won't. First of all, the code you've shown will indeed work if it's running on some special embedded device created by you. However, acessing the address of 0 (NULL) is usually a really bad idea (in usual circumstances, i.e. almost every operating system), and it's why most programmers set pointer addresses to zero when they initialize them: So it will cause a fault when you access an invalid address. So, what you need to do, is allocate your node pointer on the heap. Do this:

a * node = new a;


Don't forget to delete it when you are done with it:

delete a;


Also, since you are using C++, why not use the std::list? It would provide you with all the cool stuff like storage, traversal, etc.

Sleepy | :zzz:

Chris Richardson

C/C++ Include Finder[^]
QuestionHow to check if MS Paint is installed or not Pin
Hemant kulkarni28-Feb-03 17:31
Hemant kulkarni28-Feb-03 17:31 
AnswerRe: How to check if MS Paint is installed or not Pin
Larry Antram28-Feb-03 18:05
Larry Antram28-Feb-03 18:05 
GeneralRe: How to check if MS Paint is installed or not Pin
NormDroid2-Mar-03 4:39
professionalNormDroid2-Mar-03 4:39 
AnswerRe: How to check if MS Paint is installed or not Pin
Stephane Rodriguez.28-Feb-03 23:54
Stephane Rodriguez.28-Feb-03 23:54 
AnswerRe: How to check if MS Paint is installed or not Pin
Brian Shifrin1-Mar-03 0:01
Brian Shifrin1-Mar-03 0:01 
QuestionCan not include ntddk.h in VC7.0 Pin
George228-Feb-03 16:14
George228-Feb-03 16:14 
AnswerRe: Can not include ntddk.h in VC7.0 Pin
Zoltan Csizmadia28-Feb-03 17:03
Zoltan Csizmadia28-Feb-03 17:03 
GeneralRe: Can not include ntddk.h in VC7.0 Pin
George228-Feb-03 17:10
George228-Feb-03 17:10 
GeneralRe: Can not include ntddk.h in VC7.0 Pin
Abbas_Riazi28-Feb-03 23:45
professionalAbbas_Riazi28-Feb-03 23:45 
GeneralRe: Can not include ntddk.h in VC7.0 Pin
George21-Mar-03 1:01
George21-Mar-03 1:01 
GeneralRe: Can not include ntddk.h in VC7.0 Pin
Abbas_Riazi10-Mar-03 18:58
professionalAbbas_Riazi10-Mar-03 18:58 
GeneralRe: Can not include ntddk.h in VC7.0 Pin
George211-Mar-03 17:11
George211-Mar-03 17:11 
QuestionWhere can I get sample codes for a gateway? Pin
George228-Feb-03 14:49
George228-Feb-03 14:49 
GeneralCPropertySheet and SetDialogBkColor Pin
Chris Hafey28-Feb-03 12:01
Chris Hafey28-Feb-03 12:01 
Generalconsole application & API Pin
aguest28-Feb-03 11:48
aguest28-Feb-03 11:48 
GeneralRe: console application & API Pin
Abbas_Riazi28-Feb-03 23:52
professionalAbbas_Riazi28-Feb-03 23:52 
GeneralCEdit painting question. Pin
Maximilien28-Feb-03 10:57
Maximilien28-Feb-03 10:57 

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.