Jump to content
Sign in to follow this  
Andrew Leiper

Two For The Price Of One

Recommended Posts

Hi Pavel,

 

boostc v7.01

PIC18F2525

 

////////////////////////////////////////

#include <system.h>

#include <memory.h>

 

typedef struct {

char c;

} TTestStruct;

 

void InitNodeBuffer(TTestStruct *Node)

{

//error: arguments of 'memset8' don't match the parameters of call

//I didn't think it should be necessary to cast Node to void* here ?

memset(Node, 0, sizeof(TTestStruct));

 

memset((void*)Node, 0, sizeof(*Node)); //error: can't get size of the expression

 

memset((void*)Node, 0, sizeof(TTestStruct)); //Compiles OK

}

////////////////////////////////////////

 

Cheers,

 

Andy Leiper

IET Ltd

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×