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
 Class
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

b0211030

Bangladesh
2 Posts

Posted - 05/24/2020 :  08:32:40 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Can any one explain the use of parenthesis for the following code:
Originobj = bs;
bs=(Originobj)lay;

Chris D

428 Posts

Posted - 05/26/2020 :  07:20:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It "casts" a variable to a different type as long as they are compatible.

In you example, it casts the instance of Layer to an instance of OriginObject.

See: http://www.cplusplus.com/doc/oldtutorial/typecasting/

Thanks,
Chris Drozdowski
Originlab Technical Support
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