Solved

1<i

Posted on 2007-03-19
5
135 Views
Last Modified: 2010-04-15
BitWise
int andmask;
             for(i = 15;i >=0;i--)
             {
                   andmask =int 1<i;
                    printf("\n **** AndMask : ",andmask);
             }


Question :
1 ) What is the Meaning of  " int 1 < i " ?
 
0
Comment
Question by:gauravflame
  • 3
  • 2
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18746889
it casts the result of (1 < i)  which returns a boolean value into int, ie 0 (false) and -1 (false)
0
 

Author Comment

by:gauravflame
ID: 18746913
anything else is true ,except 0 & -1 which are false
I am right
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 18746918
no. only 0 is evaluating to false. everything else (including -1) is true
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18746920
0
 

Author Comment

by:gauravflame
ID: 18746925
fine , thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now