Click here to Skip to main content
15,909,827 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: preprocessor directives - resource Pin
వేంకటనారాయణ(venkatmakam)18-Apr-11 23:32
వేంకటనారాయణ(venkatmakam)18-Apr-11 23:32 
QuestionRe: preprocessor directives - resource Pin
g_satish19-Apr-11 0:03
g_satish19-Apr-11 0:03 
AnswerRe: preprocessor directives - resource Pin
Niklas L19-Apr-11 0:33
Niklas L19-Apr-11 0:33 
GeneralRe: preprocessor directives - resource Pin
g_satish19-Apr-11 0:42
g_satish19-Apr-11 0:42 
GeneralRe: preprocessor directives - resource Pin
David Crow19-Apr-11 7:22
David Crow19-Apr-11 7:22 
GeneralRe: preprocessor directives - resource Pin
g_satish19-Apr-11 19:12
g_satish19-Apr-11 19:12 
AnswerRe: preprocessor directives - resource Pin
వేంకటనారాయణ(venkatmakam)19-Apr-11 0:33
వేంకటనారాయణ(venkatmakam)19-Apr-11 0:33 
QuestionDuplicates in list Pin
sadas232341s18-Apr-11 8:28
sadas232341s18-Apr-11 8:28 
How to show only unique elements from this double linked list using UniqueList function? I made something, but it removes only the first...

<pre>
#include "iostream"

using namespace std;

void Add(int n);
void UniqueList();

struct Elem
{
int key;
Elem *prev;
Elem *next;
} *start;

int main()
{
int num;

while(cin >> num)
{
Add(num);
}

cout << endl;

UniqueList();

return 0;
}

void Add(int n)
{
Elem *p = start;
start = new Elem;

start->key = n;
start->next = p;
start->prev = NULL;
}

void UniqueList()
{
Elem *p = start;

if(NULL != start) cout << "The list is:" << endl;
else cout << "Empty list.";

while(NULL != p)
{ if(p->prev != p->next)
cout << p->key << endl;

p = p->next;
}
}
</pre>
AnswerRe: Duplicates in list Pin
Chris Losinger18-Apr-11 9:18
professionalChris Losinger18-Apr-11 9:18 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 9:20
sadas232341s18-Apr-11 9:20 
GeneralRe: Duplicates in list Pin
Chris Losinger18-Apr-11 9:27
professionalChris Losinger18-Apr-11 9:27 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 9:29
sadas232341s18-Apr-11 9:29 
GeneralRe: Duplicates in list Pin
Chris Losinger18-Apr-11 9:38
professionalChris Losinger18-Apr-11 9:38 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 9:39
sadas232341s18-Apr-11 9:39 
AnswerRe: Duplicates in list Pin
Luc Pattyn18-Apr-11 9:53
sitebuilderLuc Pattyn18-Apr-11 9:53 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 9:58
sadas232341s18-Apr-11 9:58 
GeneralRe: Duplicates in list Pin
Chris Losinger18-Apr-11 10:02
professionalChris Losinger18-Apr-11 10:02 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 10:13
sadas232341s18-Apr-11 10:13 
GeneralRe: Duplicates in list Pin
David Crow18-Apr-11 18:02
David Crow18-Apr-11 18:02 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 9:54
sadas232341s18-Apr-11 9:54 
GeneralRe: Duplicates in list Pin
Chris Losinger18-Apr-11 10:14
professionalChris Losinger18-Apr-11 10:14 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 10:16
sadas232341s18-Apr-11 10:16 
GeneralRe: Duplicates in list Pin
Chris Losinger18-Apr-11 10:19
professionalChris Losinger18-Apr-11 10:19 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 10:25
sadas232341s18-Apr-11 10:25 
GeneralRe: Duplicates in list Pin
sadas232341s18-Apr-11 10:32
sadas232341s18-Apr-11 10:32 

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.