how to print, say 50 blank spaces, or say 20 blank spaces ?
I wanted use such blank spaces that can be output in a program at
predetermined places when printing with "cout". 5 48200
"mark" <ma*********@yahoo.com> wrote... how to print, say 50 blank spaces, or say 20 blank spaces ?
I wanted use such blank spaces that can be output in a program at predetermined places when printing with "cout".
Use a loop
for (int i = 0; i < 50; ...
and output one space at a time
Or, declare a constant string consisting of 50 spaces and
output it.
Or, declare a constant string consisting of 5 spaces and
output it in a loop that executes 10 times.
Or, declare a constant string consisting of 10 spaces and
output it in a loop that executes 5 times.
Or, ...
Victor
On Wed, 16 Jun 2004 18:56:39 -0700, mark wrote: how to print, say 50 blank spaces, or say 20 blank spaces ?
I wanted use such blank spaces that can be output in a program at predetermined places when printing with "cout".
What are you really trying to accomplish? If you want aligned output,
look into the setw family of operations on ostreams. If you really want
to output any value more than once, loop.
--
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution.
On Thu, 17 Jun 2004 04:05:28 +0000, Victor Bazarov wrote: "mark" <ma*********@yahoo.com> wrote... how to print, say 50 blank spaces, or say 20 blank spaces ?
I wanted use such blank spaces that can be output in a program at predetermined places when printing with "cout".
Use a loop
for (int i = 0; i < 50; ...
and output one space at a time
Or, declare a constant string consisting of 50 spaces and output it.
Or, declare a constant string consisting of 5 spaces and output it in a loop that executes 10 times.
Or, declare a constant string consisting of 10 spaces and output it in a loop that executes 5 times.
Or, ...
Victor
int main(void){
int increment;
for(increment = 1; increment <= 50; increment++){
if(!(50 % increment)){
printf("Or, declare a constant string \
consisting of %i spaces and\noutput it in a loop that executes %i \
times.\n\n", increment, 50 / increment);
}
}
return 0;
}
/***
Yes, yes this is a joke.
***/
On 16 Jun 2004 18:56:39 -0700 in comp.lang.c++, ma*********@yahoo.com (mark) wrote, how to print, say 50 blank spaces, or say 20 blank spaces ?
cout << setw(50) << " ";
"mark" <ma*********@yahoo.com> wrote in message
news:5e**************************@posting.google.c om... how to print, say 50 blank spaces, or say 20 blank spaces ?
std::cout << std::string(50, ' ');
std::cout << std::string(20, ' '); I wanted use such blank spaces that can be output in a program at predetermined places when printing with "cout".
The only way you can 'predetermine' where the output goes
is to keep track of how many characters you've printed
so far on each line. There is no way to specify a
vertical position to print on a video device. I/O in
C++ is only in terms of 'streams of characters'.
-Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Buz |
last post by:
I am having a problem with extra, unwanted space showing
up on my web form tables. I've tried hand coding and can
get the htm file to display fine. But as soon as I bring
the form into Visual...
|
by: barb28 |
last post by:
Hello, sometimes I have noticed that
in web addresses, the number:
20%
will show up in the address. I think this is
somehow related to a 'blank space', but am
unsure, does anyone know about...
|
by: Penguin |
last post by:
Using Access 97, I've created a grading sheet. To save space, the
subjects
are in vertical columns on a sub-report, like so:
Math Spelling Reading
N C T A A E
U A I ...
|
by: Amir |
last post by:
I really hope someone can explain this behavior. I have spend quite a bit of
time and tried a bunch of things, so far nothing has worked.
I have a page on which I have a datagrid with template...
|
by: Bill Nguyen |
last post by:
I tried in vain to add blank space to the end of couple variables as below:
mPadding = Convert.ToChar(" ")
mdriverBegin.PadRight(16, mPadding)
mdriverEnd.PadRight(16, mPadding)
...
|
by: 一首诗 |
last post by:
Is there any simple way to solve this problem?
|
by: monica4rdecos |
last post by:
Hi,
I am developing a website. Its width is fixed and is 1000px. I want to avoid horizontal scroll bar in a standard 1024 X 768 browser. So i fixed it as 1024px width. But in firefox a blank...
|
by: Tessy Mithu |
last post by:
Am trying to print a receipt from VB6.0 with MS.Access as db.
While generating the data report iam getting blank spaces between detailed section and Bottom margin of the report.
Required to know is...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |