473,834 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text labels...

Hi

I was programming a lot in C
When i wanted to make text label i was using something like:

#define MY_PROGRAM_RESU LTS "Result of the program = %d\n"
printf(MY_PROGR AM_RESULTS, result);

But this method works only when i use stdio functions... Now i have
started using iostream cout<< and cin>> functions...

In what way should i store text labels (if i want to display few
variables in one line)?

Nov 25 '05 #1
1 1477

"peter_k" <as**@o2.pl> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Hi

I was programming a lot in C
When i wanted to make text label i was using something like:

#define MY_PROGRAM_RESU LTS "Result of the program = %d\n"
printf(MY_PROGR AM_RESULTS, result);

But this method works only when i use stdio functions... Now i have
started using iostream cout<< and cin>> functions...

In what way should i store text labels (if i want to display few
variables in one line)?


#include <iostream>
#include <sstream>
#include <string>

const std::string prog_result("Re sult of the program = ");

int main()
{
int i(42);
std::ostringstr eam oss;
oss << prog_result << i;

std::string text(oss.str()) ;
std::cout << text << '\n'; // prints: Result of the program = 42
return 0;
}

-Mike
Nov 25 '05 #2

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

Similar topics

3
3220
by: Geoff Hague | last post by:
I've got a small little problem with my 'website-in-progress': http://www.captainsoftheworld.com/modernrepublic/strict/index.php http://www.captainsoftheworld.com/modernrepublic/strict/ModernRepublic.css Is it possible, without messing around with per-pixel positioning or sizing, to make the labels ("Name" & "E-mail") in the Mailing List form line up with their associated text-input areas? In my system's setup (using IE6) the labels...
3
2537
by: Not Me | last post by:
Hi, I have a report, viewable in continuous form. I don't want the size of the report to change (it should fit address labels on the printer), but in order to minimise the space between empty fields I shrink the text boxes, bunch them together and set cangrow to on. E.g. instead of this: Some name
1
7883
by: Buddy | last post by:
Hello, Does anyone know how to stop labels from wrapping text. If the text is to long for the label then I want it to hide the text just like out the TextBox control works. Thanks,
2
2273
by: tony collier | last post by:
hi i have various labels on my page with ID's label_1, label_2 , label_3 etc. How can i write a loop that sequentially changes their text values to values i have in an array eg;. for (i=0;i<max;i++){ label_1.text = labelarray }
1
1353
by: Andy Roxburgh | last post by:
Hi, I have an monitoring application that displays various pieces of data, which are changing, on a tabpage within a form. The data is displayed in various different colours and the various items are shown in different positions on the form. It's a status panel basically. I'm originally used labels to hold all the various bits of text. I don't want to use labels because: (1) I'm using the .Net Compact Framework which only allows...
2
1424
by: rigamonk | last post by:
I have a form that runs a procedure when a button is clicked. the procedure does a few things, then outputs the results to labels on a form....which it does fine. However, when I call that procedure again (in the same instance of the program), the labels do not update. i have tried resetting the text. update(), refresh(), beginUpdate() and endUpdate(), Invalidate() and a few others that sounded pretty good ;-) no dice. any ideas?
3
1400
by: smHaig | last post by:
I have a page using a master page the master page consists of a header and left column table template. In the content area of the default page, I need to place alot of text. I initially had a table with 1 column and a number of rows for each paragraph so there would be space between each chunk of text. However, all the text would not fill up the cells (rows) but instead only about 10 letters on each line appeared with the rest of the cell...
12
13288
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the same Tag number. (I thought it might help) The checkboxes name is a concatenation of "chkCancel" and a number that represents the order in which they were created: chkCancel0 (Tag = 0) chkCancel1 (Tag = 1)
0
1612
by: Guilherme Polo | last post by:
On Thu, Sep 18, 2008 at 1:06 PM, April Lekin <lekin2@llnl.govwrote: Yes. You could separate them in two labels (if you are using labels), or apply a different tag if you are using a Text widget. Changing the color is easier, you only change the foreground option.
5
7787
by: ofilha | last post by:
I have created a report in design mode. However, some of the fields i need are dynamic. That is, i have a series of fields text boxes mostly that must show up only as needed. I also have some labels that also should dynamic depending on the text boxes. I first tried createReportcontrol during the OnOpen event for the report,and when i tried to run it, it would give me an error 2147, that i must be in design view in order to create or delete...
0
9646
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
10512
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...
1
10550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9332
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, and deployment—without 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
7760
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
5627
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3981
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3083
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.