Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Fri Sep 16, 2011 3:51 pm    Post subject: C++ question Reply with quote

Im not a c++ coder and cant make heads of this.

y = *cy + SearchDirection[*tracingdirection][0];
The part in bold. Im trying to convert an open source project to C# but this is the only part i dont understand.
Reason i ask is because the 2d array size is 8,2 but *tracingdirection within the source is only 1 or 0. How can it loop through the array.
Im guessing it has something to do with *

Anyone?
the full code
Code:
void Tracer(int *cy, int *cx, int *tracingdirection)
{
   int i, y, x;

   for(i = 0; i < 7; i++)
   {
      y = *cy + SearchDirection[*tracingdirection][0];
      x = *cx + SearchDirection[*tracingdirection][1];

      if(bitmap[y][x] == 0)
      {
         labelmap[y][x] = -1;
         *tracingdirection = (*tracingdirection + 1) % 8;
      }
      else
      {
         *cy = y;
         *cx = x;
         break;
      }
   }
}

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Sep 16, 2011 4:38 pm    Post subject: This post has 1 review(s) Reply with quote

By default you aren't allowed to use pointers in C# unless you specifically state you are using unsafe code.

Check out this page for more info:
http://msdn.microsoft.com/en-us/library/y31yhkeb.aspx

And see the other links at the bottom for more specific info and examples.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Fri Sep 16, 2011 5:27 pm    Post subject: Reply with quote

Thanks buddy
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites