Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ pointer vs. non-pointer

Name: Anonymous 2010-05-22 19:54

Sup /prog/

C++, if I make my own class, lets just say class cShitHead

cShitHead dave * new cShitHead( "dave" );
dave->PrintName();

or

cShitHead dave( "dave" );
dave.PrintName();

I myself like the pointer notation better. However, which one is more efficient and better on memory? and why?

Name: Anonymous 2010-05-23 3:02

it's not confused. automatic storage is default in c/c++ and goes on the stack.

See, that is where you are confused.  C does not specify a stack.  It is entirely up to the implementation how to arrange the automatic storage.

In before another round of "YA BUT SHOW ME  A IMPLMENTATION DAT DOESNT USE CALL STACK 4 AUTO STORAGE :D".  It amazes me what lengths people will go to avoid understanding what C is about just because it contradicts what they want to believe.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List