- Joined
- Aug 6, 2009
- Messages
- 2,148
- Reaction score
- 439
After viewing lectures I got few misc questions, plus some not related to it.
1. Pointers
Richard Buckland in his lecture about pointers noted that when you pass something to a function from main function, it get's copied in memory and technically you with with copy of that variable/object/etc inside function. With pointers you can pass pointer and work with the object/variable/etc from main function being inside sub function. Then he mentioned that sometimes computer will decide wheather or not to pass a copy or pass an address to a function.
Question. How can I determine wheather it's a copy or actual object? How to prevent it from passing original instead of making copy?
Video: YouTube - 21:Everything u need 2 know about pointers -Richard Buckland
2. Pointers in C#
In C# when you pass an object like following
Technically this is pointer, correct?
3. Pointers again
Let's say I have programs Foo1 and Foo2. Foo1 does one thing, Foo2 does another thing. And let's say they both share same class Bar. Since both programs are running on same computer, can I pass address of Foo1's Bar object address to Foo2 program, so then Foo2 can interact with Foo1's Bar object directly from memory.
Would such thing work?
4. XORing
Okay so when you xor byte with another byte
Technically 0xAC byte can be a number up to 255. What if I pass a number instead of byte and number is bigger than 255? Hows xoring done in that way?
input 10111011
0xAC 10101100
output 00010111
That works but then xoring by two bytes
input 10111011
0x01C5 111000101
output ??????
1. Pointers
Richard Buckland in his lecture about pointers noted that when you pass something to a function from main function, it get's copied in memory and technically you with with copy of that variable/object/etc inside function. With pointers you can pass pointer and work with the object/variable/etc from main function being inside sub function. Then he mentioned that sometimes computer will decide wheather or not to pass a copy or pass an address to a function.
Question. How can I determine wheather it's a copy or actual object? How to prevent it from passing original instead of making copy?
Video: YouTube - 21:Everything u need 2 know about pointers -Richard Buckland
2. Pointers in C#
In C# when you pass an object like following
Code:
MyServer serverObj = new Server();
doSomething(serverObj);
3. Pointers again
Let's say I have programs Foo1 and Foo2. Foo1 does one thing, Foo2 does another thing. And let's say they both share same class Bar. Since both programs are running on same computer, can I pass address of Foo1's Bar object address to Foo2 program, so then Foo2 can interact with Foo1's Bar object directly from memory.
Would such thing work?
4. XORing
Okay so when you xor byte with another byte
Code:
byte output = input ^ 0xAC;
input 10111011
0xAC 10101100
output 00010111
That works but then xoring by two bytes
input 10111011
0x01C5 111000101
output ??????
Last edited:

