Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help on Overlapped Serial IO Pin
patk14-Dec-02 18:49
patk14-Dec-02 18:49 
GeneralRe: Help on Overlapped Serial IO Pin
work_to_live14-Dec-02 19:23
work_to_live14-Dec-02 19:23 
GeneralRe: Help on Overlapped Serial IO Pin
work_to_live14-Dec-02 20:01
work_to_live14-Dec-02 20:01 
GeneralRe: Help on Overlapped Serial IO Pin
patk15-Dec-02 2:35
patk15-Dec-02 2:35 
GeneralDeskband remove check Pin
14-Dec-02 13:33
suss14-Dec-02 13:33 
Generalprinting a linked list Pin
Anonymous14-Dec-02 12:06
Anonymous14-Dec-02 12:06 
GeneralRe: printing a linked list Pin
Christian Graus14-Dec-02 12:33
protectorChristian Graus14-Dec-02 12:33 
GeneralRe: printing a linked list Pin
nde_plume14-Dec-02 13:06
nde_plume14-Dec-02 13:06 
You need something like this:

struct List { List * next; void * data;};

// Walk to the nth node of the list.
List* walk_n(List * lst, unsigned n)
{
for(unsigned i=0; i<n; ++i) lst = lst->next;
return lst;
}

// Walk the list calling fn on each node (until
// the list loops back to the beginning)
void listWalk(List * lst, void(*fn)(void* data))
{
List * last = lst;
do
{
fn(lst->data);
lst = lst->next;
} while (last != lst);
}

With these two functions (which I made general since your
application serves best as a composition of general functions)
you can easily provide your required functionality.

void printFromN(List* lst, unsigned n)
{
listWalk(walk_n(lst, n), printFunction);
}

where print function is some function to output the data
in a list node.

Needless to say, this code is untested, as I just typed it,
but, although there might be a few typos, I hope it communicates
the basic idea.

Of course I have assumed no null lists, that is a whole other
subject that depends on exactly how you are defining your list
structure.

HTH

GeneralPutting a control bar inside a splitter window Pin
trimtrom14-Dec-02 11:19
trimtrom14-Dec-02 11:19 
Questionhow can i check it? Pin
imran_rafique14-Dec-02 10:22
imran_rafique14-Dec-02 10:22 
AnswerRe: how can i check it? Pin
l a u r e n14-Dec-02 11:28
l a u r e n14-Dec-02 11:28 
GeneralRe: how can i check it? Pin
Christian Graus14-Dec-02 11:48
protectorChristian Graus14-Dec-02 11:48 
GeneralRe: how can i check it? Pin
imran_rafique14-Dec-02 11:52
imran_rafique14-Dec-02 11:52 
GeneralRe: how can i check it? Pin
Christian Graus14-Dec-02 12:39
protectorChristian Graus14-Dec-02 12:39 
QuestionLogitech QuickCam SDK? Pin
devvvy14-Dec-02 8:03
devvvy14-Dec-02 8:03 
AnswerRe: Logitech QuickCam SDK? Pin
Joshua Nussbaum14-Dec-02 12:13
Joshua Nussbaum14-Dec-02 12:13 
Generali downloaded the SDK Pin
devvvy14-Dec-02 14:59
devvvy14-Dec-02 14:59 
Generalone cool feature: motion detection Pin
devvvy14-Dec-02 15:07
devvvy14-Dec-02 15:07 
GeneralRe: one cool feature: motion detection Pin
leppie14-Dec-02 21:11
leppie14-Dec-02 21:11 
GeneralCWinThread and SetThreadDesktop Pin
Nish Nishant14-Dec-02 6:50
sitebuilderNish Nishant14-Dec-02 6:50 
GeneralRe: CWinThread and SetThreadDesktop Pin
Stephane Rodriguez.14-Dec-02 23:16
Stephane Rodriguez.14-Dec-02 23:16 
GeneralRe: CWinThread and SetThreadDesktop Pin
Nish Nishant14-Dec-02 23:27
sitebuilderNish Nishant14-Dec-02 23:27 
GeneralC++: playing with constructors Pin
14-Dec-02 5:43
suss14-Dec-02 5:43 
GeneralRe: C++: playing with constructors Pin
valikac14-Dec-02 6:45
valikac14-Dec-02 6:45 
GeneralRe: C++: playing with constructors Pin
- tilli -14-Dec-02 11:46
suss- tilli -14-Dec-02 11:46 

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.