Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > 2+2 Communities > Other Other Topics
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 10-03-2005, 05:41 PM
MonkeeMan MonkeeMan is offline
Junior Member
 
Join Date: Mar 2004
Location: Austin
Posts: 0
Default Re: C error

I'm guessing a missing "}".
Reply With Quote
  #12  
Old 10-03-2005, 05:46 PM
meleader2 meleader2 is offline
Senior Member
 
Join Date: Apr 2005
Location: Women are truly -EV
Posts: 320
Default Re: C error

you know looking at it, it's happening only on M_ASCII and M_BINARY my lines for those are

#define M_ASCII
#define M_BINARY

i don't have any values for it. now i gotta figure out what the hell values i should give it.

OOT > TA's and professors combined.
Reply With Quote
  #13  
Old 10-03-2005, 05:52 PM
asofel asofel is offline
Senior Member
 
Join Date: Oct 2004
Location: brilliant in my opinion
Posts: 555
Default Re: C error

[ QUOTE ]
you know looking at it, it's happening only on M_ASCII and M_BINARY my lines for those are

#define M_ASCII YSSCKY
#define M_BINARY SIIHP

i don't have any values for it. now i gotta figure out what the hell values i should give it.

OOT > TA's and professors combined.

[/ QUOTE ]

if only i could have known of OOT before I graduated...coding would have been a lot more fun.
Reply With Quote
  #14  
Old 10-03-2005, 05:59 PM
SL__72 SL__72 is offline
Junior Member
 
Join Date: May 2004
Posts: 0
Default Re: C error

Yeah... I could have come up with better names then "blah" "blah1" "asdf" etc. for my random variables...
Reply With Quote
  #15  
Old 10-03-2005, 06:01 PM
jba jba is offline
Senior Member
 
Join Date: Feb 2005
Posts: 672
Default Re: C error

i dunno how those should be defined but

if((numbytes<0) && ((charmode!=M_ASCII) || (charmode!=M_BINARY)))

is the same as

if((numbytes<0))

if M_ASCII != M_BINARY

which doesn't seem right
Reply With Quote
  #16  
Old 10-03-2005, 06:06 PM
meleader2 meleader2 is offline
Senior Member
 
Join Date: Apr 2005
Location: Women are truly -EV
Posts: 320
Default Re: C error

[ QUOTE ]
Yeah... I could have come up with better names then "blah" "blah1" "asdf" etc. for my random variables...

[/ QUOTE ]
Reply With Quote
  #17  
Old 10-03-2005, 06:08 PM
meleader2 meleader2 is offline
Senior Member
 
Join Date: Apr 2005
Location: Women are truly -EV
Posts: 320
Default Re: C error

[ QUOTE ]
i dunno how those should be defined but

if((numbytes<0) && ((charmode!=M_ASCII) || (charmode!=M_BINARY)))

is the same as

if((numbytes<0))

if M_ASCII != M_BINARY

which doesn't seem right

[/ QUOTE ]


haha that was brought up in recitation...my comment before that line:

//might need to change "&&" to "||" TA's might have messed up!

i wanted to put something else but the proooooooofessor is going to look at it.
Reply With Quote
  #18  
Old 10-03-2005, 06:13 PM
jba jba is offline
Senior Member
 
Join Date: Feb 2005
Posts: 672
Default Re: C error

well if you change the && to || it just means if(true)

the problem is in here:

((charmode!=M_ASCII) || (charmode!=M_BINARY))

this is always true.


A) your name is not fred
B) your name is not tom

A || B == true for all possible guesses regardless of your name
Reply With Quote
  #19  
Old 10-03-2005, 06:14 PM
Cosimo Cosimo is offline
Senior Member
 
Join Date: Jul 2003
Location: Austin, TX
Posts: 199
Default Re: C error

[ QUOTE ]
if((numbytes<0) && ((charmode!=M_ASCII) || (charmode!=M_BINARY)))

[/ QUOTE ]

If you've got empty #defines for M_ASCII and M_BINARY, this is gonna come out of the precompiler as:

if ((numbytes<0) && ((charmode!=) || (charmode!=)))

which is not gud.
Reply With Quote
  #20  
Old 10-03-2005, 07:49 PM
mason55 mason55 is offline
Senior Member
 
Join Date: Sep 2004
Location: All Sin Begins With Emotion
Posts: 801
Default Re: C error

[ QUOTE ]
[ QUOTE ]
if((numbytes<0) && ((charmode!=M_ASCII) || (charmode!=M_BINARY)))

[/ QUOTE ]

If you've got empty #defines for M_ASCII and M_BINARY, this is gonna come out of the precompiler as:

if ((numbytes<0) && ((charmode!=) || (charmode!=)))

which is not gud.

[/ QUOTE ]

This is the correct answer. You need to define those constants as something if you're going to compare a variable to them. Plus the || should be &&. DeMorgan's theorem and all. Or you could make it ((charmode=M_ASCII) || (charmode=M_BINARY)). Same thing.
Reply With Quote
Reply


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


All times are GMT -4. The time now is 08:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.