Whats wrong with this code?

Started by
12 comments, last by Greenfly80 22 years, 2 months ago
quote:A character holds a number from -127 to 128

The C++ standard does not specify whether char defaults to signed or unsigned; some compilers (e.g. VC++ 7) let you choose the behaviour with a compiler switch.
char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;}  /*** drpizza@battleaxe.net ***/
Advertisement
Whats wrong with U?
If one of your operands are zero, the statement will be false.
If both are non-zero it will be true(!).
might you have intended & instead of &&?

(GK)
Message from above:Damn, my hair is grey!
Whats wrong with U?
If one of your operands are zero, the statement will be false.
If both are non-zero it will be true(!).
might you have intended & instead of &&?

(GK)


Message from above:
Damn, my hair is grey!
Message from above:Damn, my hair is grey!
quote:Original post by Oluseyi
And introduced a few others.

Use std::string () if you''re using C++. It''s by far more convenient (ie, it''s time to ditch strcmp, etc people).

I guess you''re right. strcmp and the likes have always worked fine for me so I haven''t bothered to check out anything else.



-----------------------------
"problems have solutions
a lifetime of fucking things up fixed in one determined flash"
- The Downward Spiral, NIN
-----------------------------Reporter: Are they slow-moving, chief?Sheriff: Yeah, they're dead. They're all messed up.-Night of the living dead

This topic is closed to new replies.

Advertisement