Jump to content
  • Advertisement
Sign in to follow this  
Dead_Zone

ok ok ok

This topic is 4480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i know i really shouldnt be dabbling in this till i have more experience in C++ but this task was asigned to me so please bare with my stupidity
		garble1 -> md5.Update(hash, sizeof(hash)); md5.Final(garble1);
		garble2 -> md5.Update(hash, sizeof(hash)); md5.Update((u8 *)szSeed, strlen(szSeed)); md5.Final(garble2);
		garble3 -> md5.Update(garble1, sizeof(garble1)); md5.Final(garble3);
that is the code thats giving me errors but it's only the "garble1-3 ->" pointers heres is the errors
.\main.cpp(54) : error C2227: left of '->md5' must point to class/struct/union/generic type
        type is 'byte *'
.\main.cpp(54) : error C2228: left of '.Update' must have class/struct/union
.\main.cpp(55) : error C2227: left of '->md5' must point to class/struct/union/generic type
        type is 'byte *'
.\main.cpp(55) : error C2228: left of '.Update' must have class/struct/union
.\main.cpp(56) : error C2227: left of '->md5' must point to class/struct/union/generic type
        type is 'byte *'
.\main.cpp(56) : error C2228: left of '.Update' must have class/struct/union
now can anyone be nice enough to try and help me figure out a solution or atleast give me a hint? thank you very much

Share this post


Link to post
Share on other sites
Advertisement
The error messages say that garble1, garble2, and garble3 are bytes, not class/struct/union, and you can't use -> on bytes. Tell us how you declare the garbles.

Share this post


Link to post
Share on other sites
Didn't you ask this in a previous post? You got an answer there, too.

-> is the "indirect access" operator. It is applied on the right of a POINTER to a struct or class in order to access a member of said struct or class. If the object that -> is applied to is not a pointer (and doesn't overload operator->, but you need not concern yourself with that case), then application of -> is invalid. Instead you should use the . operator. For example:


SomeStruct foo;
SomeStruct *bar = new SomeStruct;

foo.baz = 10; // Direct access via . operator.
bar->baz = 20; // Indirect access via -> operator.


Also not that applying either . or -> on the right of an object without members (such as a regular int) isn't valid either.

Sounds to me like garble1 through garble3 are not pointers to objects.

Share this post


Link to post
Share on other sites
Quote:
Original post by alnite
The error messages say that garble1, garble2, and garble3 are bytes, not class/struct/union, and you can't use -> on bytes. Tell us how you declare the garbles.


He's declared them as 'int's, to which I've told him in his other post 3 times (here, here, and here) what the problem is. I don't know if he has my responses filtered out or what... Maybe someone else can explain it [wink]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!