473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Printing help

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[i]=temp;
}
cout<<"Your set is: \n";
run.setString();

Nov 13 '07 #1
2 1427

"Latina" <sd****@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
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<<"}";
}
IntergerSet is some class. It seems to have some variable set.
//main
main()
{
IntegerSet run;

int temp, ele;
int newSet[26];
newSet is an interger array.
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[i]=temp;
You are assigning the values to the integer array.
}
cout<<"Your set is: \n";
run.setString();
setString is working on it's array, which newSet is not a part of.
setString can't output this set becuase it doesn't see it.
Nov 13 '07 #2
On Nov 12, 7:25 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
"Latina" <sdl...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...


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<<"}";
}

IntergerSet is some class. It seems to have some variable set.
//main
main()
{
IntegerSet run;
int temp, ele;
int newSet[26];

newSet is an interger array.
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[i]=temp;

You are assigning the values to the integer array.
}
cout<<"Your set is: \n";
run.setString();

setString is working on it's array, which newSet is not a part of.
setString can't output this set becuase it doesn't see it.- Hide quoted text -

- Show quoted text -
I got it.

Nov 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: DotNetDummy | last post by:
Hi all, I am trying to set the printing setting e.g duplex mode etc. on a default printer when I.E object started printing a particular html doc. Here's the partial code, any help would be...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
0
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.