Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Why pointers?

Reply
Thread Tools

Why pointers?

 
 
Juha Nieminen
Guest
Posts: n/a
 
      02-14-2008
saneman wrote:
> But does anyone have an idea to a minimal example where its impossible
> to avoid pointer?


Try creating a linked list without pointers.
 
Reply With Quote
 
 
 
 
Lionel B
Guest
Posts: n/a
 
      02-14-2008
On Thu, 14 Feb 2008 14:00:10 +0200, Juha Nieminen wrote:

> saneman wrote:
>> But does anyone have an idea to a minimal example where its impossible
>> to avoid pointer?

>
> Try creating a linked list without pointers.


Sure it's possible... clunky, painful and probably inefficient, but
possible (e.g. use arrays for storage and arrays of indices for access).

--
Lionel B
 
Reply With Quote
 
 
 
 
Pete Becker
Guest
Posts: n/a
 
      02-14-2008
On 2008-02-14 10:35:15 -0500, Lionel B <(E-Mail Removed)> said:

> On Thu, 14 Feb 2008 14:00:10 +0200, Juha Nieminen wrote:
>
>> saneman wrote:
>>> But does anyone have an idea to a minimal example where its impossible
>>> to avoid pointer?

>>
>> Try creating a linked list without pointers.

>
> Sure it's possible... clunky, painful and probably inefficient, but
> possible (e.g. use arrays for storage and arrays of indices for access).


But given that it's hypothetically impossible to give such an example
(a Turing machine doesn't have pointers), examples that are clunky,
painful, and inefficient without pointers are good answers.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

 
Reply With Quote
 
Daniel T.
Guest
Posts: n/a
 
      02-15-2008
saneman <(E-Mail Removed)> wrote:

> Sorry for the confusion. I would like an example where its impossible to
> avoid use 'new' (dynamic allocation).
>
> The reason is that I often use pointers and references but seldom the
> keyword 'new'.


You seldom use the keyword 'new'? Sounds like you have answered your own
question. Try to go back and do the same thing without the keyword.

In C++, you should be using 'new' very rarely.
 
Reply With Quote
 
arnuld
Guest
Posts: n/a
 
      02-27-2008
> On Fri, 15 Feb 2008 07:19:02 -0500, Daniel T. wrote:

> In C++, you should be using 'new' very rarely.


Oh.. I did not know that



--
http://lispmachine.wordpress.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Cisco 2611 and Cisco 1721 : Why , why , why ????? sam@nospam.org Cisco 10 05-01-2005 08:49 AM
Why, why, why??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 6 01-27-2005 03:35 PM
Why Why Why You HAVE NO IDEA MCSE 31 04-24-2004 06:40 PM



Advertisments