Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 16th, 2006, 8:57 AM   #11
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,207
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by rup
Because in C++ a cast is applied this way : void(variable) I had left it that way.
Rubbish. A cast is not applied "this way" in C nor in C++.
grumpy is offline   Reply With Quote
Old Apr 16th, 2006, 6:14 PM   #12
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by rup
Because in C++ a cast is applied this way : void(variable) I had left it that way.
When I get around to designing my own programming language, I'll be sure to add the 'feature'.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Apr 16th, 2006, 9:59 PM   #13
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,207
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by nnxion
When I get around to designing my own programming language, I'll be sure to add the 'feature'.
Oh? And what will this 'feature' do???
grumpy is offline   Reply With Quote
Old Apr 17th, 2006, 5:22 AM   #14
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by grumpy
Oh? And what will this 'feature' do???
The same as (void)(variable).
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Apr 17th, 2006, 6:55 AM   #15
Jason Isom
Programmer
 
Join Date: Dec 2005
Posts: 53
Rep Power: 3 Jason Isom is on a distinguished road
Quote:
Originally Posted by grumpy
Rubbish. A cast is not applied "this way" in C nor in C++.
http://publib.boulder.ibm.com/infoce...ef/cplr188.htm
Quote:
Originally Posted by IBM
In C++ you can also use the following in cast expressions:

* Function-style casts
* C++ conversion operators, such as static_cast.
Are you implying that IBM is wrong?
Jason Isom is offline   Reply With Quote
Old Apr 17th, 2006, 7:04 AM   #16
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Despite the fact that your reference link redirects so many time it gave me an epileptic seizure, I didn't see anything (in the 1.5 seconds I had to look) that contradicts what has been said here. As to your ultimate question, I would be happy to imply that IBM is often wrong. They chose Intel and Microsoft as the foundation of their PC, didn't they?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Apr 17th, 2006, 7:13 AM   #17
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,207
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by Jason Isom
Are you implying that IBM is wrong?
No, I am not. The example used by rup is invalid: "void(variable)" represents a conversion to void which is not possible as it is not possible to have a variable of type void. int(variable) is used to convert variable to int, and is sometimes described as a "function style cast" to int.
grumpy is offline   Reply With Quote
Old Apr 17th, 2006, 1:17 PM   #18
rup
Newbie
 
Join Date: Jul 2005
Location: India
Posts: 14
Rep Power: 0 rup is on a distinguished road
Me no guru programmer. I accept that lack of accuracy is not called for. Thanks Grumpy for the tip. Had your post come a bit earlier I wouldn't have got so scared :-) And I don't think I was wrong about the C++ cast style.
rup is offline   Reply With Quote
Old Apr 17th, 2006, 2:24 PM   #19
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Buy some gloves. Shovel handles are harder on the fingers than keyboards.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:53 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC