The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 operator overloading possible? / error-handling
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

TreeNode

64 Posts

Posted - 12/21/2010 :  12:10:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: Origin8, SR6
Operating System: Win XP

Hi,

is operator overloading possible in OriginC?
Like:
void MyError::operator<<(int nErrorCode)
{
	ReceiveOccuredError(nErrorCode);
}

I imagined to create a MyError-Object, which receives occured errors of called methods.
With this object I could return Error-Messages when some errors occured.

Or would you recommend to use try and catch statements for error-handling?

|-- TreeNode
...|-- a??
...|-- ha!!

Penn

China
644 Posts

Posted - 12/21/2010 :  9:14:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi TreeNode,

I am sorry that Origin C does not support operator overloading. However, as you said, you can use try and catch statements for error handling. Also, the throw statement is supported. Please refer to this page for more details.

Penn
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000