Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 HELP regarding bitwise operators!!!
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
A.J




PostPosted: Fri Mar 14, 2008 6:18 pm   Post subject: HELP regarding bitwise operators!!!

why isn't this allowed in C++:
C:

trans2[1,n+1-i] = trans2[1,n+1-i] | (1 << (n-j));

it says invalid operands of types...
could someone help?
(btw, trans2 is integer type)
Sponsor
Sponsor
Sponsor
sponsor
Saad




PostPosted: Fri Mar 14, 2008 6:24 pm   Post subject: RE:HELP regarding bitwise operators!!!

trans2[1,n+1-i] = trans2[1,n+1-i] | (1 << (n-j));

To access each dimension of an array uses the [] operator, as a result it should be trans[1][n+1-i] rather then [1 , n + 1 - 1]
A.J




PostPosted: Fri Mar 14, 2008 6:31 pm   Post subject: Re: HELP regarding bitwise operators!!!

thnx saad.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: