![]() |
| | #1 |
| C 1337 Join Date: Nov 2006
Posts: 70
| does C# have pointers?? and if the answer is no .. how can i implement the static/dynamic hashing? |
| Meshal is offline | |
| | #2 |
| the hat of redundancy hat Join Date: Aug 2001 Location: Hannover, Germany
Posts: 2,769
| The answer is yes and yes and no. Basically, every reference type in .NET is a pointer. You can have explicit pointers in unmanaged code including a ton of complications that come with the full unmanaged package. And no, to the user, nothing in C# is handled like a pointer. There is no dereferencing or an -> operator. I don't really know what you mean with dynamic/static hashing, but you can implement it in C#. Maybe you can explain what you want to achieve.
__________________ hth -nv She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate." When in doubt, read the FAQ. Then ask a smart question. |
| nvoigt is offline | |
| | #3 |
| C 1337 Join Date: Nov 2006
Posts: 70
| thanks for answers my questions .. and what i mean by static and dynamic hashing is this: statick-hashing http://www.cs.sfu.ca/CC/354/zaiane/m...00000000000000 http://www.dis.uniroma1.it/~catarci/...3LT/sld003.htm dynamic hashing(extensible hashing) http://www.dis.uniroma1.it/~catarci/...3LT/sld005.htm how can i implement those hashing technique in C# , because i need a pointer to point to the buckets buckets = blocks |
| Meshal is offline | |
| | #4 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| You use references to point to the buckets, in simple, standard C#. There's nothing special about hashing in this regard.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #5 |
| C 1337 Join Date: Nov 2006
Posts: 70
| how i can reference to point to the bucket ?? can you show me an example ?! |
| Meshal is offline | |
| | #6 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Code: Bucket[] buckets = new Bucket[numBuckets];
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #7 |
| Registered User Join Date: Apr 2007
Posts: 45
| Yeah gotta love C# for this particular ambiguity
__________________ we are one |
| wiiire is offline | |
| | #8 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Which one?
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #9 |
| Registered User Join Date: Apr 2007
Posts: 45
| Its illustrious memory handling
__________________ we are one |
| wiiire is offline | |
| | #10 |
| C 1337 Join Date: Nov 2006
Posts: 70
| so how can binary tree or binary search programmed in C# without using real pointers ?!! |
| Meshal is offline | |
| | #11 |
| the hat of redundancy hat Join Date: Aug 2001 Location: Hannover, Germany
Posts: 2,769
| C# has pointers. It's just that C# has nothing else that's probably a bit confusing. Every reference type in C# is what C++ would call a pointer. You just don't need to free the memory, because it's managed/garbage collected. And you don't need those pointer semantics/syntactics, because the compiler already knows if something is a pointer ( reference type ) or not ( value type ). CObject* o = new CObject( "test" ); // perfectly valid C++ Object o = new Object( "test" ); // perfectly valid C# Those two lines are exactly the same. An object is created dynamically.
__________________ hth -nv She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate." When in doubt, read the FAQ. Then ask a smart question. |
| nvoigt is offline | |
| | #12 |
| System Novice Join Date: Jan 2006 Location: Tehran
Posts: 1,075
| C# supports C++ type pointers. But it is called unsafe code. It is better to use .NET standard libs for those kind of operations OR you may go to MSDN for unsafe code.
__________________ Microsoft Visual Studio 2008 Professional (On Microsoft Windows XP SP2) Learn the language before using it. (C++ Books and C Books) Read the FAQ before making a problem. Then make a Google and Forum search. My code painter new version Version 0.97 DOWNLOAD NOW! (Let the pop up, pop!) SiavoshKC |
| siavoshkc is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using pointers to pointers | steve1_rm | C Programming | 18 | 05-29-2008 05:59 AM |
| function pointers | benhaldor | C Programming | 4 | 08-19-2007 10:56 AM |
| Request for comments | Prelude | A Brief History of Cprogramming.com | 15 | 01-02-2004 10:33 AM |
| Staticly Bound Member Function Pointers | Polymorphic OOP | C++ Programming | 29 | 11-28-2002 01:18 PM |