![]() |
|
[C] repeat choosing color in c with do while - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] repeat choosing color in c with do while (/showthread.php?tid=6144920) |
repeat choosing color in c with do while - blackcoder00 - Mar 16, 2021 i want to repeat choosing a color until i press n when the program ask me if i want to keep choosing PHP Code RE: repeat choosing color in c with do while - HFDone - Mar 16, 2021 somthing like PHP Code edit - will post code later if i get free time RE: repeat choosing color in c with do while - Loki123 - Mar 17, 2021 Why don't you use an endless loop and exit at a signal then ? The tricky part is where you'd be assigning a single char to int along with comparing a char to int.. That causes unexpected behavior. But my "partial" solution would be like this: PHP Code Now... If I am understanding what you want to do correctly. But I have no idea what you want to do with char rep[10]; Edit: A slightly modified version of the code above and made into a do - while loop. PHP Code RE: repeat choosing color in c with do while - HFDone - Mar 17, 2021 he is learning and practicing scanf you can use default for other key PHP Code RE: repeat choosing color in c with do while - Loki123 - Mar 17, 2021 (Mar 17, 2021 01:12 PM)HFDone Wrote: he is learning and practicing scanf He can, yes as showed in my edit with a do - while loop. |