Hello boys and girls,
I'm wondering around with arrays and I'm trying to get one up so that it grabs a user inputt'd char and adds it on then prints out the contents of the array so far
ie "Enter character" :
User enters : 'A'
Prints out A on screen
"Enter character" :
User enters B
Printsout A and B on screen.
I've got no problem populating and printing out arrays, but I cant figure this one out.
I've thought adding to strings but no luck there.
I've got this so far but it doesnt help at all and I know why but not sure how to defeat this...
...
int i;
for (i = 0 ; 1 < 5 ; i++)
{
cin >> buffer[i];
}
for (i = 0 ; i < 5; i++)
{
cout << buffer[i]
}
whilst this code doesnt do what ask'd
I thought'd about how to get one step closer:
for (i = 0 ; 1 < 5 ; i++)
{
cin >> buffer[i];
{
for (i = 0 ; i < 5; i++)
{
cout << buffer[i]
}
}
}
but still fails....can anyone help us out here?