473,388 Members | 1,417 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,388 software developers and data experts.

I want to set fmtflag

hi
I want to set a format flag what is the right code
example
format flag as (right)or(left)
thank you
bye
Feb 9 '08 #1
3 1763
mohamed azaz wrote:
I want to set a format flag what is the right code
example
format flag as (right)or(left)
It is not clear what you need. Could you please post some sample code,
or some pseudo-code showing what you need? A small example, with
comments instead of code for the part you're not sure about, would be a
big help.
Feb 9 '08 #2
cout.setf(ios::left); // left justify output text
cout >"This text is left-justified";
cout.unsetf(ios::left); // return to default (right justified)

this code doesn't work

Feb 10 '08 #3
mohamed azaz wrote:
cout.setf(ios::left); // left justify output text
cout >"This text is left-justified";
cout << "This text is left-justified";
cout.unsetf(ios::left); // return to default (right justified)

this code doesn't work
The problem has nothing to do with the flags. You have used the
extraction operator (>>) when you needed the insertion operator (<<).
The arrows indicate the direction of information flow: During
extraction, a value is moved from the stream to the variable (stream >>
variable). During insertion, a value is moved from the variable to the
stream (stream << variable).
Feb 10 '08 #4

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

Similar topics

0
by: reynArd | last post by:
"I can teach anyone how to get what they want out of life. The problem is I can't find anybody who can tell me what they want." -- Mark Twain "Today people in America can become whatever they want....
0
by: reynArd | last post by:
"I can teach anyone how to get what they want out of life. The problem is I can't find anybody who can tell me what they want." -- Mark Twain "Today people in America can become whatever they want....
5
by: mr.iali | last post by:
Hi Everyone I would like to get into software developent using a programming language like c++, java or pl/sql for oracle. I have no idea where to start from. Which language is there more...
7
by: sumi | last post by:
Hi, from my login i want to login as a other user , how can i do it using python.
7
by: Anne M | last post by:
I have a report based on query..which is a team list with names and their role on team ie coach, assistant and player. Report is almost what I want and my knowledge is limited so I need some...
4
by: veereshai | last post by:
i want to copy the functions from my source file into a new file...and convert each function into a new object file by compiling it. now, i want to invoke the function using the object file i have...
10
by: Atul | last post by:
Hi, I just stepped into C#. I am facing one problem. Here is the scenario. I am posting some data to one website (https site). It returns me response HTML. I want to parse this HTML and want to...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
4
by: Chris F Clark | last post by:
Please excuse the length of this post, I am unfortunately long-winded, and don't know how to make my postings more brief. I have a C++ class library (and application generator, called Yacc++(r)...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...

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.