TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jay S
NA
230
59.4k
Using tilde (~) error
May 27 2013 2:35 PM
I have seen a portion of code that looks like this:
public static short ReadEncryptedShort2(int ReputationAddress)
{
int bits = ReputationAddress & 15;
ushort num = (ushort)MainProcess.ReadShort(ReputationAddress);
num = (ushort)MainProcess.rol_short((uint)num, bits);
num = ~num;
num = (ushort)MainProcess.rol_short((uint)num, 12);
num = ~num;
num = (ushort)MainProcess.rol_short((uint)num, bits);
return (short)num;
}
I've never seen the use of "~" before so am not sure how to debug.
I've googled the usage and its something to do with flipping the bytes(?)
The error i am getting it:
Cannot implicitly convert type 'int' to 'ushort'. An explicit conversion exists (are you missing a cast?)
can someone help point me in the right direction whats going on and why the error. Do i need some special reference/assembly to use the "~"?
Thanks,
Reply
Answers (
1
)
Question on Multilevel inheritance
C sharp reference variables..