help on how to terminate a program

Hi so I am doing this project on parsing numbers which has to do with ignoring certain things like , and . in a list of numbers. and our teacher wants the program to know that the list is over when we enter in a ';' Like for example if we put 1,231; it would know that the number is 1231. All i know how to do is make it so that a negative number -1 can terminate the list. how can i do this?
Ok so I found out by reading our assignment that i have to use a switch statement. So I added
case ';': (But what would I put here to tell the program to make this the last digit in the array) please help
you could use a while loop, in that while loop you put the switch case part and when ";" comes up you change the parameter of the while loop.

example

1
2
3
4
5
6
bool running = true;
while(running)
{
   if(whateveryourvariableiscalled == ";") 
       {running = false;}
}
Topic archived. No new replies allowed.