operator * overloading C++

Pages: 12
In other words: C++ does not restrict the introduction of prohibiting keywords >:)

Edit: P.S. precisely passing by reference is where I had to first use const. I pass arguments by pointer only when the value 0 is allowed, in which case the pointer 0 stands for "no input"-flag.

Edit 2. Although I never figured out what is the problem with
1
2
3
4
void foo(int& x)
{}

foo(5);

I see no problem with the programmer being stupid enough as to try to modify the value of the constant 5. Even if the physical address of the constant 5 is located on a Read-Only-Memory, I still see no problem letting your computer crash your program with some nasty error message.
Last edited on
Topic archived. No new replies allowed.
Pages: 12