overloading []

This is a discussion on overloading [] within the C++ Programming forums, part of the General Programming Boards category; when I am overloading the [] operators, do I declare them like so: operator[](string key){ or like so: operator[string key]{ ...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    86

    overloading []

    when I am overloading the [] operators, do I declare them like so:

    operator[](string key){

    or like so:

    operator[string key]{

    ??

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    39
    operator[](string key)

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    the first one

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    86
    thanx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help on understandind arrays
    By C++mastawannabe in forum C++ Programming
    Replies: 9
    Last Post: 06-16-2007, 11:50 PM
  2. Overloading [] operator for a vector
    By nappaji in forum C++ Programming
    Replies: 4
    Last Post: 05-01-2007, 11:44 AM
  3. Overloading [] and Assignment
    By Mastadex in forum C++ Programming
    Replies: 6
    Last Post: 12-24-2006, 12:22 PM
  4. crazy = and [] operator overloading question
    By jarro_2783 in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2006, 09:56 PM
  5. Overloading the [] operator trouble
    By rmullen3 in forum C++ Programming
    Replies: 2
    Last Post: 08-01-2002, 01:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21