Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2004

Tip: Looking for answers? Try searching our database.

void* and arrays

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nanditha Chandra - 17 Sep 2004 13:09 GMT
Hi!

I have a newbie question regarding void*. I am reposting this since I
am still not clear.

In native C++ you can have a function that takes a void* and you can
call that function with pointer to array or any other kind for that
matter. Here is an example

Foo(void*);

// You can later call this foo() as

short* shbuf = new buf[100];
foo(shbuf);

long lx = 1;
foo(&lx);

etc.

In MC++, is there a way to do this. I need a generic function that can
be used with value types or arrays of value types. I cannot use
Object* since Foo() will be called with value types or arrays of value
types most of the time.

Thanks,
D
James Curran - 17 Sep 2004 20:38 GMT
   I have trouble imagining what goes on in such a function that could take
pointers to scalars & pointers to arrays with not additional
information.....

   Have you considered two separate functions?

Signature

Truth,
James Curran
Home: www.noveltheory.com       Work: www.njtheater.com
Blog: www.honestillusion.com  Day Job: www.partsearch.com
                                               (note new day job!)

> Hi!
>
[quoted text clipped - 24 lines]
> Thanks,
> D

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.