Creating an Operator

This is a discussion on Creating an Operator within the C++ Programming forums, part of the General Programming Boards category; Just wondering if it is possible to create your own operator? ex use <- instead of << so cin >> ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    39

    Creating an Operator

    Just wondering if it is possible to create your own operator? ex

    use <- instead of <<

    so
    cin >> test

    cin <-test
    or just
    <- test

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    like this?
    Code:
    #include <iostream>
    #define _ std::cout<<
    
    int main()
    {
    	_ "test\n";
        return 0;
    }

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    No. You can not make up your own operators.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 10:38 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 08:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  4. Replies: 21
    Last Post: 04-25-2005, 08:18 PM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-07-2003, 12:51 AM

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