The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SED * operator sinpeak Shell Programming and Scripting 7 12-24-2008 10:07 AM
Modulus operator manash.paul Shell Programming and Scripting 5 11-07-2008 09:21 AM
! operator in variable mmunir Shell Programming and Scripting 1 05-30-2008 04:29 AM
Or operator with if babom HP-UX 1 10-03-2007 04:56 PM
And operator rcarnesiii Shell Programming and Scripting 4 08-04-2005 03:04 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-01-2009
Nagapandi Nagapandi is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 36
new operator

Hi,

Please clear the 2 questions,

2 Questions,

1) Why the new as a operator? Is there any special reason why it can't be a function like malloc?

2) How are we considering sizeof(),new are as a opearartors? I know + - * / -> , . etc.. are operators, which criteria satisfied by sizeof() since we are calling sizeof with function call operators "()".

Thanks,
Naga
  #2 (permalink)  
Old 02-01-2009
davo666 davo666 is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 2
are you kidding?

sizeof - what ever you wanna mesaure the size of, pretty much any variable name
  #3 (permalink)  
Old 02-01-2009
Nagapandi Nagapandi is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 36
Hi,

Thanks for your reply, I know the usage of sizeof operator, please once again read my 2 questions and request you to answer it.

Thanks,
Naga
  #4 (permalink)  
Old 02-01-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,942
Quote:
Originally Posted by Nagapandi View Post
Hi,

Please clear the 2 questions,

2 Questions,

1) Why the new as a operator? Is there any special reason why it can't be a function like malloc?
because that was the fad when it was designed, to mix system-dependent, OS-dependent, and language-dependent things together into one glorious operator-overloadable mess. It cannot be a library function because such things don't have access to constructors and destructors, it has to be a language feature.
  #5 (permalink)  
Old 02-02-2009
Nagapandi Nagapandi is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 36
Hi,

Woww Thanks Mr. Corona688, i got the answer from your reply.

Thanks,
Naga
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 12:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0