Click here to Skip to main content
15,900,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUndefined Value Pin
Anu_Bala24-Dec-09 21:52
Anu_Bala24-Dec-09 21:52 
AnswerRe: Undefined Value [modified] Pin
Nelek25-Dec-09 0:50
protectorNelek25-Dec-09 0:50 
GeneralRe: Undefined Value Pin
Anu_Bala25-Dec-09 20:01
Anu_Bala25-Dec-09 20:01 
GeneralRe: Undefined Value Pin
Nelek25-Dec-09 22:50
protectorNelek25-Dec-09 22:50 
AnswerRe: Undefined Value Pin
«_Superman_»25-Dec-09 2:30
professional«_Superman_»25-Dec-09 2:30 
QuestionLinked Lists Pin
Razanust24-Dec-09 19:30
Razanust24-Dec-09 19:30 
AnswerRe: Linked Lists Pin
Tim Craig24-Dec-09 20:37
Tim Craig24-Dec-09 20:37 
AnswerRe: Linked Lists Pin
Nelek25-Dec-09 0:38
protectorNelek25-Dec-09 0:38 
If you just do the next a pointer to a int* then you won't be able to have more elements, you are going to miss the "next" pointer on the following item.

In other words...

struct list {
int val;
struct list * next;
};


allows you to have a lot of items connected with "next"

struct list {
int val;
int* next;
};


Here you have ONLY one item, with two elements, an integer and a pointer to an integer.


Think about... what would happen if you add more elements to your item? you could have, for instance...

struct list {
int iVal;
double dFactor;
char cType;
//and so on...
struct list * next;
};


Which pointer would you need to go to the next item in your list? int*? char*? double*?

That's the reason why you need to use struct list* next.

Regards.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.

GeneralRe: Linked Lists Pin
Razanust27-Dec-09 6:25
Razanust27-Dec-09 6:25 
GeneralRe: Linked Lists Pin
Nelek27-Dec-09 22:10
protectorNelek27-Dec-09 22:10 
AnswerRe: Linked Lists Pin
Luc Pattyn25-Dec-09 2:37
sitebuilderLuc Pattyn25-Dec-09 2:37 
QuestionCString::MakeUpper() and MakeLower() for Non-English language Pin
includeh1024-Dec-09 18:22
includeh1024-Dec-09 18:22 
AnswerRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
Tim Craig24-Dec-09 20:59
Tim Craig24-Dec-09 20:59 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
includeh1024-Dec-09 21:50
includeh1024-Dec-09 21:50 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
Nelek25-Dec-09 0:32
protectorNelek25-Dec-09 0:32 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
Tim Craig25-Dec-09 8:01
Tim Craig25-Dec-09 8:01 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
LunaticFringe25-Dec-09 8:24
LunaticFringe25-Dec-09 8:24 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
Tim Craig25-Dec-09 14:05
Tim Craig25-Dec-09 14:05 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
LunaticFringe25-Dec-09 15:20
LunaticFringe25-Dec-09 15:20 
GeneralRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
Tim Craig25-Dec-09 16:34
Tim Craig25-Dec-09 16:34 
AnswerRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
David Crow28-Dec-09 16:14
David Crow28-Dec-09 16:14 
AnswerRe: CString::MakeUpper() and MakeLower() for Non-English language Pin
raja jamwal31-Dec-09 8:53
raja jamwal31-Dec-09 8:53 
QuestionHow to assign to array? Pin
milestanley24-Dec-09 15:44
milestanley24-Dec-09 15:44 
AnswerRe: How to assign to array? Pin
includeh1024-Dec-09 18:27
includeh1024-Dec-09 18:27 
GeneralRe: How to assign to array? Pin
Tim Craig24-Dec-09 20:43
Tim Craig24-Dec-09 20:43 

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.