/*Hi,
I was trying to optimize my application in C.
In that process to reduce the complexity at condition checks which of the below is efficient,*/
if(bFlag1 && !(Var == 1) && bFlag2) //or
if(bFlag1 & !(Var == 1) & bFlag2)
Falcon143
0
Newbie Poster
Recommended Answers
Jump to Post&& is bitwise AND operator.
& is refrencing operator.& cannot be used instead of &&. Aren't you getting error on using & ?
Jump to PostTo optimize a program:
1) remember your first priority is always an accurate program. A wrong answer might be infinitely fast, but it's still wrong, and probably useless. Get and keep your program accurate.
2) the largest optimizing you can do, (by far), is with the choice of the algorithm …
All 6 Replies
Rahul47
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Adak
419
Nearly a Posting Virtuoso
Tumlee
42
Junior Poster in Training
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Falcon143
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.