Res: [c-prog] Re: integer promotions

2008-11-25 Thread Pedro Izecksohn
--- peternilsson42 wrote: So you made absolutely _no_ change to the semantics of that assignment! I fixed the signal to make others happy. You seem to be only interested in one class of machine. why do you think that? Or, do you think different values should be displayed? My previous

Res: Res: [c-prog] Re: integer promotions

2008-11-25 Thread Pedro Izecksohn
--- I wrote: It is mathematically obvious the Intel's approach. I thought it applied wherever it is possible. Correction: I thought the mathematically obvious approach would be applied wherever possible.

[c-prog] Exception handling

2008-11-25 Thread crystalcat_75
Following program is showing an error while running in turbo c : undefined symbol for try statement missing after try . #includeconio.h #includestdlib.h #includeiostream.h void main() { clrscr(); int a,b,c; coutenter two valuesendl; cinab; try { if(b0) { coutresult(a/b)= a/bendl; } else {

Re: [c-prog] Exception handling

2008-11-25 Thread Tamas Marki
On Tue, Nov 25, 2008 at 3:10 PM, crystalcat_75 [EMAIL PROTECTED] wrote: Following program is showing an error while running in turbo c : undefined symbol for try statement missing after try . Turbo C is an ancient compiler that predates the current C++ standard. This means that if you try to

Re: [c-prog] Exception handling

2008-11-25 Thread Brett McCoy
On Tue, Nov 25, 2008 at 9:10 AM, crystalcat_75 [EMAIL PROTECTED] wrote: Following program is showing an error while running in turbo c : undefined symbol for try statement missing after try . I don't think Turbo C supports exceptions. You need to upgrade to a modern compiler like Dev-C++ or MS

[c-prog] unary operators

2008-11-25 Thread Tyler Littlefield
Hello, I did a google for this, and came up with the wrong results. I've got a line of code that reads: str=i==1?is||are; the compiler is choking; ideas would be great, not sure what Im messing up. Thanks, Tyler Littlefield email: [EMAIL PROTECTED] web: tysdomain-com Visit for quality software

Re: [c-prog] unary operators

2008-11-25 Thread andrew clarke
On Tue 2008-11-25 09:48:24 UTC-0700, Tyler Littlefield ([EMAIL PROTECTED]) wrote: I've got a line of code that reads: str=i==1?is||are; the compiler is choking; ideas would be great, not sure what Im messing up. I think you mean the ternary operator: str = i == 1 ? is : are; This is

Re: [c-prog] unary operators

2008-11-25 Thread Brett McCoy
On Tue, Nov 25, 2008 at 11:48 AM, Tyler Littlefield [EMAIL PROTECTED] wrote: Hello, I did a google for this, and came up with the wrong results. I've got a line of code that reads: str=i==1?is||are; the compiler is choking; ideas would be great, not sure what Im messing up. should be str =

Re: [c-prog] unary operators

2008-11-25 Thread Tyler Littlefield
awesome, thanks. maybe that's why google wasn't turning up results. :) Thanks, Tyler Littlefield email: [EMAIL PROTECTED] web: tysdomain-com Visit for quality software and web design. skype: st8amnd2005 - Original Message - From: Brett McCoy To: c-prog@yahoogroups.com Sent:

Res: [c-prog] Re: integer promotions

2008-11-25 Thread peternilsson42
Pedro Izecksohn [EMAIL PROTECTED] wrote: peternilsson42 wrote: [ unsigned short int a; a = USHRT_MAX; /* previously a = -1; */] So you made absolutely _no_ change to the semantics of that assignment! I fixed the signal to make others happy. You must be referring to Thomas'

Res: Res: [c-prog] Re: integer promotions

2008-11-25 Thread Pedro Izecksohn
--- peternilsson42 wrote: Ah, then you've probably been fooled by the cliché that C is just portable assembler. If I could do just one modification to the standard, I'd add an overflow macro, like errno.

Res: Res: [c-prog] Re: integer promotions

2008-11-25 Thread peternilsson42
Pedro Izecksohn [EMAIL PROTECTED] wrote: --- peternilsson42 wrote: Ah, then you've probably been fooled by the cliché that C is just portable assembler. If I could do just one modification to the standard, I'd add an overflow macro, like errno. The behaviour on integer overflow is

[c-prog] Re: unary operators

2008-11-25 Thread peternilsson42
Brett McCoy [EMAIL PROTECTED] wrote: str = i == 1 ? is : are; It's known as the tertiary or ternary operator, BTW. It should be known by its name: conditional operator. -- Peter

[c-prog] Re: Help required for creating enum

2008-11-25 Thread peternilsson42
u will know when u IM me [EMAIL PROTECTED] wrote: I want to create an enum variable whose size is 4 byte in 32- machine and 8 bytes on 64 bit machines. Your nearest bet is... enum my_enum { my_enum_constant = INT_MAX; } my_enum_variable; Basically, I want to knopw whether one can specify

Res: Res: Res: [c-prog] Re: integer promotions

2008-11-25 Thread Pedro Izecksohn
--- I wrote: If I could do just one modification to the standard, I'd add an overflow macro, like errno. --- peternilsson42 replied: The behaviour on integer overflow is undefined. Hence, implementations already have the freedom to do precisely that if they so choose. [That they don't is

Re: Res: [c-prog] Re: integer promotions

2008-11-25 Thread Thomas Hruska
peternilsson42 wrote: Pedro Izecksohn [EMAIL PROTECTED] wrote: peternilsson42 wrote: [ unsigned short int a; a = USHRT_MAX; /* previously a = -1; */] So you made absolutely _no_ change to the semantics of that assignment! I fixed the signal to make others happy. You must

Re: Res: [c-prog] Re: integer promotions

2008-11-25 Thread Pedro Izecksohn
--- Thomas Hruska wrote: There would also have been warnings on the next line of code with the compiler complaining about a signed to unsigned conversion or something like that. That would have been the more useful clue to the OP that a weird conversion was happening behind the scenes.

Re: Res: [c-prog] Re: integer promotions

2008-11-25 Thread Thomas Hruska
Pedro Izecksohn wrote: --- Thomas Hruska wrote: There would also have been warnings on the next line of code with the compiler complaining about a signed to unsigned conversion or something like that. That would have been the more useful clue to the OP that a weird conversion was

Res: [c-prog] Re: integer promotions

2008-11-25 Thread peternilsson42
Pedro Izecksohn [EMAIL PROTECTED] wrote: --- Thomas Hruska wrote: peternilsson42 wrote: Pedro Izecksohn [EMAIL PROTECTED] wrote: peternilsson42 wrote: [ unsigned short int a; a = USHRT_MAX; /* previously a = -1; */ ] So you made absolutely _no_ change to the semantics of

[c-prog] Re: Exception handling

2008-11-25 Thread Saurabh Jain
--- In c-prog@yahoogroups.com, crystalcat_75 [EMAIL PROTECTED] Following program is showing an error while running in turbo c : undefined symbol for try statement missing after try . snip Upgrade your compiler please! Regards, Saurabh