• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple continue/stop question  RSS feed

 
Kev Woo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make my program have a continue option "(y/n)?"

Is there a method which does this or will I have to use a boolean expression?

Thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no specific method to call for this -- you'll need to write things out yourself.
 
Kev Woo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so I used a do-while statement but it's not compiling correctly. I get the error message "variable play might not have been initialized" for the while at the end. I declared the type within the parameters so I don't know what's wrong with it

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kev Woo wrote: I get the error message "variable play might not have been initialized" for the while at the end. I declared the type within the parameters so I don't know what's wrong with it


The "might have not been initialize" message is caused when the compiler finds a path through the code, where something might have not been initialized.

In this case, can you find a path through this code where play does not get initialized?



Henry
 
Kev Woo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah ok fixed it. Thank you!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!