You are here:

C++/do while loops


can you declare more than one condition for a while loop (such as while (hp>0 || Ehp >0);
This is a summary of my code and it keeps repeating until both are true. how do i make it do or statements. Visual studio

Josh , Thank you for your question.

Unfortunately, you have not given enough information for me to be able to answer your question. Please resubmit your question with more details or a clearer description and I will do my best to answer.

Yes, you may use any logical (truth-valued) expression to control a do/while loop.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2016 All rights reserved.