Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with C++ looping; simple question concerning input of "0."
New Posts  All Forums:Forum Nav:

Help with C++ looping; simple question concerning input of "0." - Page 2

post #11 of 13
Quote:
Originally Posted by di inferi View Post

Ahhhh, so I made true the while condition, removed anything concerning zero ending the loop, and regardless of input it runs infinitely.
Is setting the while condition to true just sort of a catch all "always run this" condition?
Thank you all for the help.

If you do while(true) it becomes an infinite loop. Then you can use continue to get to next iteration or break to get out of the loop. It depends on what you want.
post #12 of 13
Only thing to note is to make sure to thoroughly test your code when using a while(true) condition.

I have ran into problems in the past when using this in a UI and it would preform every previous function call along with new function calls.
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
post #13 of 13

-Edit-

Nevermind

NanoGenesis
(37 items)
 
B166ER v2.12
(13 items)
 
 
CPUMotherboardGraphicsGraphics
AMD Phenom II X4 955 Black Edition ASUS M5A99X EVO MSI N560GTX-Ti Twin Fzror II/OC @ 8x MSI N560GTX-Ti Twin Fzror II/OC @ 8x 
RAMRAMRAMRAM
Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v 
Hard DriveHard DriveOptical DriveOptical Drive
1TB WD Caviar Black WD1002FAEX 1TB Seagate Baracuda 7200.12 (RMA) LG 24x DVDRAM GH22NS50 Sony 20x Optiarc DVD RW AD-740S 
CoolingCoolingCoolingCooling
CoolerMaster Hyper 212 EVO P/P CoolerMaster XtraFlow 2200RPM  CoolerMaster Red LED 2000RPM CoolerMaster Red LED 2000RPM 
CoolingCoolingCoolingCooling
CoolerMaster Red LED 2000RPM CoolerMaster PWM 2000RPM  CoolerMaster Red LED 2000RPM  CoolerMaster Red LED 2000RPM 
CoolingCoolingCoolingCooling
AMD Stock HeatSink Fan 7000RPM Corsair Case 120mm 1200RPM CoolerMaster S12 120mm 1200RPM CoolerMaster S12 120mm 1200RPM 
CoolingCoolingCoolingCooling
CoolerMaster S12 120mm 1200RPM CoolerMaster S12 120mm 1200RPM CoolerMaster V1 Thermal Compound  CoolerMaster XtraFlow 2200RPM 
OSMonitorKeyboardPower
Windows 7 Ultimate x64 Samsung S22A350H TVS Champ Corsair TX850V2 
CaseMouseAudioAudio
Corsair Carbide 400R Logitech Logitech H110 Sony MDR-ZX700 
Audio
iball 5.1 iBooster 
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E7400 Gigabyte G31M-S2L Sapphire Ati Raedon HD 5670 Kingston 
RAMHard DriveOptical DriveCooling
Kingston Seagate Baracuda 7200.12 22x ASUS Stock 
OSMonitorPowerCase
Windows 7 Ultimate 64bit Panasonic 19" Foxin 500W Xenitus 
Audio
Logitech 
  hide details  
Reply
NanoGenesis
(37 items)
 
B166ER v2.12
(13 items)
 
 
CPUMotherboardGraphicsGraphics
AMD Phenom II X4 955 Black Edition ASUS M5A99X EVO MSI N560GTX-Ti Twin Fzror II/OC @ 8x MSI N560GTX-Ti Twin Fzror II/OC @ 8x 
RAMRAMRAMRAM
Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v Kingston 2Gb DDR3 1600mhz 9-9-9-24-2T 1.65v 
Hard DriveHard DriveOptical DriveOptical Drive
1TB WD Caviar Black WD1002FAEX 1TB Seagate Baracuda 7200.12 (RMA) LG 24x DVDRAM GH22NS50 Sony 20x Optiarc DVD RW AD-740S 
CoolingCoolingCoolingCooling
CoolerMaster Hyper 212 EVO P/P CoolerMaster XtraFlow 2200RPM  CoolerMaster Red LED 2000RPM CoolerMaster Red LED 2000RPM 
CoolingCoolingCoolingCooling
CoolerMaster Red LED 2000RPM CoolerMaster PWM 2000RPM  CoolerMaster Red LED 2000RPM  CoolerMaster Red LED 2000RPM 
CoolingCoolingCoolingCooling
AMD Stock HeatSink Fan 7000RPM Corsair Case 120mm 1200RPM CoolerMaster S12 120mm 1200RPM CoolerMaster S12 120mm 1200RPM 
CoolingCoolingCoolingCooling
CoolerMaster S12 120mm 1200RPM CoolerMaster S12 120mm 1200RPM CoolerMaster V1 Thermal Compound  CoolerMaster XtraFlow 2200RPM 
OSMonitorKeyboardPower
Windows 7 Ultimate x64 Samsung S22A350H TVS Champ Corsair TX850V2 
CaseMouseAudioAudio
Corsair Carbide 400R Logitech Logitech H110 Sony MDR-ZX700 
Audio
iball 5.1 iBooster 
CPUMotherboardGraphicsRAM
Intel Core 2 Duo E7400 Gigabyte G31M-S2L Sapphire Ati Raedon HD 5670 Kingston 
RAMHard DriveOptical DriveCooling
Kingston Seagate Baracuda 7200.12 22x ASUS Stock 
OSMonitorPowerCase
Windows 7 Ultimate 64bit Panasonic 19" Foxin 500W Xenitus 
Audio
Logitech 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with C++ looping; simple question concerning input of "0."