473,769 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::set String()
{
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 1447

"Latina" <sd****@gmail.c omwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.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::set String()
{
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...@rock etmail.comwrote :
"Latina" <sdl...@gmail.c omwrote in message

news:11******** **************@ k79g2000hse.goo glegroups.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::set String()
{
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
2300
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 some problems I encountered while using them. Please note that, the Regional and Language setting on my machine is using "Metric" measurement system (where the default is "US"). In this case, the measurement unit is "milimeters" and not "inches".
0
2127
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 some problems I encountered while using them. Please note that, the Regional and Language setting on my machine is using "Metric" measurement system (where the default is "US"). In this case, the measurement unit is "milimeters" and not "inches".
0
1649
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 appreciated. I have been using system.drawing.printing method but not much help since drawing.printing required printDocument() object which specially
5
3351
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 = "P:\2004worksheets\IIS_WS.doc" Set oWord = New Word.Application oWord.Documents.Add (strObjectPath) oWord.PrintOut
4
9346
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 this differences increases with the increase number of labels. The code is as follwods: Here rdr = OleDbDataReader Font is Times New Roman, 12pt
0
1837
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 with the file system (including printing) from the web browser. How do I disabled this so I can get my windows form control to work within IE? Also, do any have any printing code or know how I can implement multipage printing using the...
2
2539
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 locations. But After printing first page it increase paper 3cm vertically/Height so on second
12
6379
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 of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
6
4088
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 the user wants all pages will produce 3 pages. I want to offer the user the ability to select via the print dialog that only pages 1 and 2 of it are printed or possibly pages 1 and 3 but not 2. At the moment I can produce all three pages...
8
5912
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 clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8870
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.