C中的解析错误 [英] Parse Error in C

查看:69
本文介绍了C中的解析错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一些按位操作作业,它说我的代码有一个解析错误" 我假设其语法或其他内容...但是找不到丢失的分号或其他内容. 您能找出我为什么会遇到问题的原因吗?

I'm doing some bitwise operation homework and it says my code has a "parse error" I'm assuming its the syntax or something...but I can't find a missing semi-colon or anything. Could you please spot why I might be getting the problem?

int isGreater(int x, int y)
{
      int xSign = (x>>31);
      int ySign = (y>>31);
      int check1 = (xSign & ySign) | (~xSign & ~ySign);
      int same = ( x + ((~y) + 1) )>>31;
      same = !(same & 0x1);
      int check2 = (check1 & same) | (~check1 & !xSign);
      int equal = (!(x ^ y))<<31>>31;
      return (equal & 0) | (~equal & check2);
}

推荐答案

肯定有一些令人毛骨悚然的事情.也许您的编辑器将<<>>与某些Unicode字符«»冲突.

There must be something fishy going on. Perhaps your editor clashed the << or >> to some unicode character « or ».

或者相反,您正在写< <> >且在某处有空格.然后,解析将看到两个不同的令牌,例如<<而不是一个<<.

Or the inverse you are writing < < or > > with a space somewhere. The parse then sees two distinct tokens e.g < and < instead of one <<.

这篇关于C中的解析错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆