473,408 Members | 2,888 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,408 software developers and data experts.

TAB displayed differently ?

Why is it, when you compile and run these using Visual Studio 2005,
the escape sequence is displayed diffently ?

The first one is displayed with a TAB lenght of 4 space charaters,
while the second is only displayed with the TAB length of 2 space
characters ?

std::cout << "Before one TAB escape sequence |\t| after one TAB
escape sequence." << std::endl;

std::cout << "Before one TAB escape sequence\tafter the TAB escape
sequence." << std::endl;
Feb 25 '07 #1
7 1598
MrNewsReader wrote:
Why is it, when you compile and run these using Visual Studio 2005,
the escape sequence is displayed diffently ?

The first one is displayed with a TAB lenght of 4 space charaters,
while the second is only displayed with the TAB length of 2 space
characters ?

std::cout << "Before one TAB escape sequence |\t| after one TAB
escape sequence." << std::endl;

std::cout << "Before one TAB escape sequence\tafter the TAB escape
sequence." << std::endl;
Effects of outputting special characters is platform-specific. Why
don't you ask about those in a Windows programming newsgroup?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Feb 25 '07 #2
On Sun, 25 Feb 2007 14:20:18 -0500, "Victor Bazarov"
<v.********@comAcast.netwrote:
>MrNewsReader wrote:
>Why is it, when you compile and run these using Visual Studio 2005,
the escape sequence is displayed diffently ?

The first one is displayed with a TAB lenght of 4 space charaters,
while the second is only displayed with the TAB length of 2 space
characters ?

std::cout << "Before one TAB escape sequence |\t| after one TAB
escape sequence." << std::endl;

std::cout << "Before one TAB escape sequence\tafter the TAB escape
sequence." << std::endl;

Effects of outputting special characters is platform-specific. Why
don't you ask about those in a Windows programming newsgroup?

V
hmm...Windows programming newsgroup...you mean like MFC and such ?
This C++ code, is just made for the console window, but I haven't
posted the whole code ;-)

MrNewsReader
Feb 25 '07 #3
MrNewsReader wrote:
On Sun, 25 Feb 2007 14:20:18 -0500, "Victor Bazarov"
<v.********@comAcast.netwrote:
>MrNewsReader wrote:
>>Why is it, when you compile and run these using Visual Studio 2005,
the escape sequence is displayed diffently ?

The first one is displayed with a TAB lenght of 4 space charaters,
while the second is only displayed with the TAB length of 2 space
characters ?

std::cout << "Before one TAB escape sequence |\t| after one TAB
escape sequence." << std::endl;

std::cout << "Before one TAB escape sequence\tafter the TAB escape
sequence." << std::endl;

Effects of outputting special characters is platform-specific. Why
don't you ask about those in a Windows programming newsgroup?

V

hmm...Windows programming newsgroup...you mean like MFC and such ?
No, I don't mean like MFC and such. I mean a Windows programming NG.
This C++ code, is just made for the console window, but I haven't
posted the whole code ;-)
There is no such concept as "console window" in C++. If you cannot
ask your question without involving that, you're stuck with platform-
specificity. The list of newsgroups to consider is in in the FAQ.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Feb 25 '07 #4
In article <gn********************************@4ax.com>,
Mr**********@GoFigure.com says...
Why is it, when you compile and run these using Visual Studio 2005,
the escape sequence is displayed diffently ?

The first one is displayed with a TAB lenght of 4 space charaters,
while the second is only displayed with the TAB length of 2 space
characters ?

std::cout << "Before one TAB escape sequence |\t| after one TAB
escape sequence." << std::endl;

std::cout << "Before one TAB escape sequence\tafter the TAB escape
sequence." << std::endl;
As has already been mentioned, the effects are platform-specific.

That said, in many implementations, a tab aligns output to a multiple of
some number of character cells (e.g. 8). In such a case, a tab will
display as a variable amount of space, depending upon the alignment up
to that point.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Feb 25 '07 #5
On Sun, 25 Feb 2007 13:46:59 -0700, Jerry Coffin <jc*****@taeus.com>
wrote:
>In article <gn********************************@4ax.com>,
Mr**********@GoFigure.com says...
>Why is it, when you compile and run these using Visual Studio 2005,
the escape sequence is displayed diffently ?

The first one is displayed with a TAB lenght of 4 space charaters,
while the second is only displayed with the TAB length of 2 space
characters ?

std::cout << "Before one TAB escape sequence |\t| after one TAB
escape sequence." << std::endl;

std::cout << "Before one TAB escape sequence\tafter the TAB escape
sequence." << std::endl;

As has already been mentioned, the effects are platform-specific.

That said, in many implementations, a tab aligns output to a multiple of
some number of character cells (e.g. 8). In such a case, a tab will
display as a variable amount of space, depending upon the alignment up
to that point.
Hi Jerry

Thanks for your reply !
I have searched around to find a Windows programming newsgroup like
Victor mentioned, but I can't seem to find one. Do you have some
specific newsgroup in mind, where such a question is valid ?

Thanks
MrNewsReader
Feb 25 '07 #6
MrNewsReader wrote:
I have searched around to find a Windows programming newsgroup like
Victor mentioned, but I can't seem to find one. Do you have some
specific newsgroup in mind, where such a question is valid ?
Section 5.9 of this group's FAQ gives a list of newgroups tangentially
related to C++, and what is topical in each.

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Alan Johnson
Feb 25 '07 #7
MrNewsReader wrote:
The first one is displayed with a TAB lenght of 4 space
charaters, while the second is only displayed with the
TAB length of 2 space characters ?
Assume a tab size of 8 characters and assuming you
are reading this reply with a mono-spaced font.

This gives the following tab stops :

T T T T T

Now line these up with your output:

T T T T T
Before one TAB escape sequence | | after one TAB escape
sequence.

T T T T T
Before one TAB escape sequence after the TAB escape sequence.

By definition the tab character will move to the next tab stop.
Notice
how this can create a tab of differing length.
I have searched around to find a Windows programming
newsgroup like Victor mentioned, but I can't seem to
find one.
Try comp.os.ms-windows.programmer.win32

Jussi Jumppanen
Author: Zeus for Windows IDE
http://www.zeusedit.com

Feb 26 '07 #8

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

Similar topics

6
by: christian9997 | last post by:
Hi I would be very helpful if someone could help me with this code. It works fine in IE but when I display it in Netscape or Firefox and I move the mouse from one menu to the other the gap...
0
by: Mr. x | last post by:
Hello, I am sending this emal again, because it was a week ago, and I want to clarify some new things. I have problem on .NET, which are seen differently on IE and Netscape. Look at sit of...
3
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image...
2
by: jburkle | last post by:
The following is the onclick method called when the "Renew" button is clicked by the user in my Windows application: ..... Private Sub cmdRenew_Click(ByVal eventSender As System.Object, ByVal...
15
by: Joe Weinstein | last post by:
Hi. Below is a simple JDBC program to insert and extract a numerical value. When ResultSet.getDouble() is called, the same program produces different output on solaris than it does on Linux. I...
8
by: kj | last post by:
Is there a simple way to decouple the value attribute of a submit button from the text that actually gets displayed on it? In principle, what I'm looking for is something like <input...
6
by: Samuel | last post by:
Hi I noticed that IE 7 shows the pictures differently they seem smaller or bigger Any clue? Thank you, Samuel
2
by: Jim | last post by:
Hello, I need a program that will traverse a directory tree to ensure that there are unix-style line endings on every file in that tree that is a text file. To tell text files from others I...
4
by: vishwadeepsharma | last post by:
Hi Freinds, We are facing a very strange problem. Our system consists of UNIX batches which call the PLSQL procedures to execute the validations on the database. We have a list of plsql procedure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
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
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...
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.