C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 14th, 2005, 03:38 AM
sumitk_roy sumitk_roy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 sumitk_roy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 9 sec
Reputation Power: 0
overloading

HOW to overload subscript operator to get the largest of elements in an array.

Reply With Quote
  #2  
Old June 14th, 2005, 01:01 PM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 273 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 35 m 2 sec
Reputation Power: 4
As far my knowldege, you can not overload '[]' operator. Similarly the ternary operator can not be overloaded too.

Reply With Quote
  #3  
Old June 20th, 2005, 10:48 PM
Kain Kain is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 6 Kain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by Cirus
As far my knowldege, you can not overload '[]' operator. Similarly the ternary operator can not be overloaded too.


You actually can overload []
http://www.cplusplus.com/doc/tutorial/tut4-2.html

That website shows all of what you can overload.

I think there are five operators that can't be overloaded:

. .* :: ?: sizeof()

Reply With Quote
  #4  
Old July 2nd, 2005, 06:28 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
Send a message via AIM to ubergeek
Kain, that's true, but I think what Cirus was getting at (or even if it wasn't what he meant) you can't overload any operator for data-types that aren't classes or structs.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > overloading


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway