L
Latina
Hi, Can some one help to figure out why is only printing '{ }' and not
the values the user is entering?
Here is part of my code:
void IntegerSet::setString()
{
cout<<"{";
for(element=0; element<26; element++)
{
if(set[element]==true)
{
cout<<" "<<element<<" ";
}
}
cout<<"}";
}
//main
main()
{
IntegerSet run;
int temp, ele;
int newSet[26];
cout<<"\n WELCOME to the INTEGER SET PROGRAM!\n\n";
cout<<"Maximun elements in the set is 25\n";
cout<<"Enter how many elements you want in the set: ";
cin>>ele;
cout<<"Enter the values: \n";
for(int i=0; i<ele; i++)
{
cout<<i+1<<": ";
cin>>temp;
newSet=temp;
}
cout<<"Your set is: \n";
run.setString();
the values the user is entering?
Here is part of my code:
void IntegerSet::setString()
{
cout<<"{";
for(element=0; element<26; element++)
{
if(set[element]==true)
{
cout<<" "<<element<<" ";
}
}
cout<<"}";
}
//main
main()
{
IntegerSet run;
int temp, ele;
int newSet[26];
cout<<"\n WELCOME to the INTEGER SET PROGRAM!\n\n";
cout<<"Maximun elements in the set is 25\n";
cout<<"Enter how many elements you want in the set: ";
cin>>ele;
cout<<"Enter the values: \n";
for(int i=0; i<ele; i++)
{
cout<<i+1<<": ";
cin>>temp;
newSet=temp;
}
cout<<"Your set is: \n";
run.setString();