View Single Post
  #2   Spotlight this post!  
Unread 07-12-2011, 20:46
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Press Enter to Add One

Try something like this:

Code:
//make sure you #include <iostream>
int count = 0; //variable to store count
while(count < 10){ //this will only run 10 times
    system("pause"); //wait for user to press enter - this will send the Windows shell command "pause", and wait for the user to press enter
    count++; //increment count
    std::cout << "Count: " << count << endl; //show count to user
}
You'll need a variable to store the running count, and after the user presses enter, it'll have to be incremented. Does that snippet make sense logically?
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android

Last edited by plnyyanks : 07-12-2011 at 21:47. Reason: forgot "std::" - good catch. or, put "using namespace std;" at the top of the program
Reply With Quote