overloading, l value, defrence operator

This is a discussion on overloading, l value, defrence operator within the C++ Programming forums, part of the General Programming Boards category; I just wanted to know what overloading, l value, and derefrence operator are because my teacher assigned me to understand ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    3

    overloading, l value, derefrence operator

    I just wanted to know what overloading, l value, and derefrence operator are because my teacher assigned me to understand these subjects. I tried to search the website for anything about these subjects but found nothing sorry if i missed a post that asked this question.
    Last edited by _WaR_iS_pEaCe_; 01-14-2003 at 12:10 PM.

  2. #2
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078

    Re: overloading, l value, defrence operator

    Originally posted by _WaR_iS_pEaCe_
    I just wanted to know what overloading, l value, and defrence operator are because my teacher assigned me to understand these subjects. I tried to search the website for anything about these subjects but found nothing sorry if i missed a post taht asked this question.
    Overloading is creating several different functions that share the same name but take different arguments.

    An lvalue is a location value -- a place that you can not only get data from but also take the address of, write to, etc.

    The dereference operator is the asterisk.
    *
    It's unary; you use it before a pointer to access the data being pointed to rather than the data's location in memory.
    Last edited by Polymorphic OOP; 01-06-2003 at 10:10 PM.

  3. #3
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Here's sites about overloading.

    You might wanna try Google.com next time:

    http://www.cplusplus.com/doc/tutorial/tut4-2.html

    There's one and here's the Google search I found it with:

    http://www.google.com/search?hl=en&i...ading+Tutorial

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    3

    thanks for the definitions

    i have to talk about the dereference operator for about 1 minute tommorow in my class and all i have is your defenition can someone help me out? like maybe show me an example so i can make a poster of it.
    Last edited by _WaR_iS_pEaCe_; 01-14-2003 at 11:43 AM.

  5. #5
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    801
    You fellas are in the same class aren't you?
    Attached Images Attached Images  

  6. #6
    samurai warrior nextus's Avatar
    Join Date
    Nov 2001
    Posts
    196
    ok...
    let see some code

    Code:
    int number = 5;
    int* pnumber = 0; // pnumber is a pointer to int & points to nothing
    
    pnumber = &number; // pnumber now contains the address of number
    
    *pnumber += 5; // i implicitly incremented number (5) by 5 now number contains 5 so...
    
    std::cout << *pnumber << " is equal to " << number << endl;
    std::cout << pnumber <<  " is equal to " << &number << endl;
    * can dereference a pointer and get the value the pointer is pointing to..

    & is the address of operator and gives the address in memory of a variable (plus other things like references...but thats for another day )

    also its get more complicated..but i thinks thats the basic....oh yea arrays and pointers are very similar....
    nextus, the samurai warrior

  7. #7
    Registered User
    Join Date
    Jan 2003
    Posts
    3
    Originally posted by minesweeper
    You fellas are in the same class aren't you?
    yes we are in the same class thank you for telling me i didnt know he didnt tell me...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. unary operator overloading and classes
    By coletek in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2009, 01:14 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Operator Overloading (Bug, or error in code?)
    By QuietWhistler in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2006, 07:38 AM
  4. C++ Operator Overloading help
    By Bartosz in forum C++ Programming
    Replies: 2
    Last Post: 08-17-2005, 12:55 PM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM

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