You are not logged in.

#1 2010-04-23 23:56:28

gobeav3rs297
Member
From: Portland Oregon
Registered: 2007-11-06
Posts: 60

question about port C++ code to C

I have a newbie question about C++

I'm being ask to port a C++ sharelib into a kernel driver for work so from C++ => C.  I'm not at all familiar with C++ but i'm making some leeway.  However i'm a little stuck, what does the following line of code in bold mean in C++ and how would I translate it into C code

#include <deque>

...
...
...

struct _buffer
{
    UINT8* buffer;
    UINT8 length;
};

typedef deque< struct _buffer* > MSGQUEUE;

I'm assuming it's type defining a deque of the struct _buffer???  but I'm confused by the <...>, what does that operator do in C++.  Is it defining a struct _buffer pointer within the deque??? 

This might like a "DUH it means...." question to some people so sorry about the stupid question.

--Vincent

Offline

#2 2010-04-23 23:59:30

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,487
Website

Re: question about port C++ code to C

<> is template syntax and is generally the type of object a container holds..   So it is defining that the MSGQUEUE type is a deque holding struct_buffer*'s.

Offline

#3 2010-04-24 00:33:40

gobeav3rs297
Member
From: Portland Oregon
Registered: 2007-11-06
Posts: 60

Re: question about port C++ code to C

thank you very much for the explaination smile

--Vincent

Offline

Board footer

Powered by FluxBB