Original Post
🔒 Locked
array and LPDIRECTDRAW7
Advertisement
The answer is the line should read:
image.srf = array[0]; // notice not img AND . instead of ->
since image is a struct (not a pointer to a struct) you use the .(dot) operator to access it''s members.
BTW ... are you using C or C++??? you wrote your struct definition in old C style NOT C++ ... in c++ it should be like this:
struct sth{
LPDIRECTDRAWSURFACE7 srf;
};
notice ... no typedef ... and no name following the end brace ... the name gets assigned from the one given between the word struct and the opening brace .. just like classes ...
good luck
image.srf = array[0]; // notice not img AND . instead of ->
since image is a struct (not a pointer to a struct) you use the .(dot) operator to access it''s members.
BTW ... are you using C or C++??? you wrote your struct definition in old C style NOT C++ ... in c++ it should be like this:
struct sth{
LPDIRECTDRAWSURFACE7 srf;
};
notice ... no typedef ... and no name following the end brace ... the name gets assigned from the one given between the word struct and the opening brace .. just like classes ...
good luck
Or if you use C:
image = calloc(1, sizeof(sth));
------------------------------
#pragma twice
image = calloc(1, sizeof(sth));
------------------------------
#pragma twice
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement