
September 14th, 2004, 06:01 PM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
noob program ? loop
first off just want to say i know this ? is going to be really silly but i can't figure out how to break this loop i mean if u key in 'y' or 'n' the loop will continue...anyways anyone help?
Code:
#include <iostream>
using namespace std;
int main()
{
char decision;
while(decision='y')
{
const int MaxSize=20;
char barcode[MaxSize];
cout<<"Enter barcode: ";
cin>>barcode;
cout<<"Enter another barcode? (y or n): ";
cin>>decision;
}
return 0;
}
anyways i just started programming...also how do i get the char array back to an int array?
if anyone has a sugestion on how to do the loop a different way they are welcome =)
thanks ahead of time
oh btw, that isnt near the whole program =)
|