Results 1 to 1 of 1

Thread: Trying to understand some code?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Trying to understand some code?

    Hello,

    Given the following code:
    table[city] = population;

    How is it possible to get the value of population inside the overloaded function:
    int& HashTable:perator[](string key);

    When only the key [city] is passed in?

    Edit:
    Let me clarify a little bit:
    The table is a class that we've been provided and we've been provided the header file of said class and must fill out the implementation file of this class. Since we can't edit the header file, I was wondering how this is possible?
    Last edited by Slyke; May 20th, 2013 at 03:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width