Strange Output

Hello, everybody !!!
Why this fragment of code shows : ac

cout<<"a\??/??/bc";

Thanks All !!!


0
firejump (26)
10/1/2004 3:29:58 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
911 Views

Similar Articles

[PageSpeed] 45

"Alex Dmitriev" <firejump@mail.ru> wrote in message
news:ecTgPp8pEHA.3800@TK2MSFTNGP14.phx.gbl...
> Hello, everybody !!!
> Why this fragment of code shows : ac
>
> cout<<"a\??/??/bc";

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccelng4/html/elconTrigraphs.asp

'??/' is a '\' so you end up with "a\\\bc"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccelng4/html/elconescapesequences.asp

'\b' is a backspace
'\\' is a '\'

so "a\\\bc" translates to "a\<backspace>c" which backspaces over the first
'\' resulting in:

"ac"

-- 
Jeff Partch [VC++ MVP]


0
jeffp (1712)
10/1/2004 3:42:27 PM
On Fri, 1 Oct 2004 18:29:58 +0300, "Alex Dmitriev" <firejump@mail.ru>
wrote:

>Hello, everybody !!!
>Why this fragment of code shows : ac
>
>cout<<"a\??/??/bc";
>
>Thanks All !!!
>

Is this homework?

If so, look up trigraphs to see just what ??/ represents.

Then look up escape sequences to see just what \\ represents.

Finally look up escape sequences to see just what \b represents.

If it is not homework, then I am afraid you will still have to do the
same thing.

If you had a computer connected to a teletype or a DECwriter or some
other form of actual typing machine, you would see exactly why your
screen only shows ac.


0
r
10/1/2004 3:45:45 PM
"Jeff Partch" <jeffp@mvps.org> �������/�������� � �������� ���������:
news:uezXC18pEHA.3324@TK2MSFTNGP15.phx.gbl...
> "Alex Dmitriev" <firejump@mail.ru> wrote in message
> news:ecTgPp8pEHA.3800@TK2MSFTNGP14.phx.gbl...
> > Hello, everybody !!!
> > Why this fragment of code shows : ac
> >
> > cout<<"a\??/??/bc";
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccelng4/html/elconTrigraphs.asp
>
> '??/' is a '\' so you end up with "a\\\bc"
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccelng4/html/elconescapesequences.asp
>
> '\b' is a backspace
> '\\' is a '\'
>
> so "a\\\bc" translates to "a\<backspace>c" which backspaces over the first
> '\' resulting in:
>
> "ac"
>
> -- 
> Jeff Partch [VC++ MVP]
>
>
Thanks !!!
I didn't know this !!!
Only one question ???
Is this rule in standard C99 ???
Cause I saw it first time


0
firejump (26)
10/1/2004 4:14:48 PM
Footnote: if you had it coupled to a Teletype, you would see a\c, because Teletypes did
not implement backspace...the carriage could only move forward! (I go back to where the
Teletype was an ADVANCE in computer input media, since it was so much better than using a
punched card deck!)
					joe

On Fri, 01 Oct 2004 11:45:45 -0400, r norman <rsn_@_comcast.net> wrote:

>On Fri, 1 Oct 2004 18:29:58 +0300, "Alex Dmitriev" <firejump@mail.ru>
>wrote:
>
>>Hello, everybody !!!
>>Why this fragment of code shows : ac
>>
>>cout<<"a\??/??/bc";
>>
>>Thanks All !!!
>>
>
>Is this homework?
>
>If so, look up trigraphs to see just what ??/ represents.
>
>Then look up escape sequences to see just what \\ represents.
>
>Finally look up escape sequences to see just what \b represents.
>
>If it is not homework, then I am afraid you will still have to do the
>same thing.
>
>If you had a computer connected to a teletype or a DECwriter or some
>other form of actual typing machine, you would see exactly why your
>screen only shows ac.
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
10/3/2004 8:21:19 PM
On Sun, 03 Oct 2004 16:21:19 -0400, Joseph M. Newcomer
<newcomer@flounder.com> wrote:

>Footnote: if you had it coupled to a Teletype, you would see a\c, because Teletypes did
>not implement backspace...the carriage could only move forward! (I go back to where the
>Teletype was an ADVANCE in computer input media, since it was so much better than using a
>punched card deck!)
>					joe

Do you also remember special "archival quality" mylar tape for
punching?  My tapes are in perfect, pristine condition and probably
will remain so for hundreds of years.  Unfortunately, they don't seem
to be all that useful!


0
r
10/3/2004 10:23:42 PM
r norman <rsn_@_comcast.net> wrote:

>On Sun, 03 Oct 2004 16:21:19 -0400, Joseph M. Newcomer
><newcomer@flounder.com> wrote:
>
>>Footnote: if you had it coupled to a Teletype, you would see a\c, because Teletypes did
>>not implement backspace...the carriage could only move forward! (I go back to where the
>>Teletype was an ADVANCE in computer input media, since it was so much better than using a
>>punched card deck!)

>Do you also remember special "archival quality" mylar tape for
>punching?  My tapes are in perfect, pristine condition and probably
>will remain so for hundreds of years.  Unfortunately, they don't seem
>to be all that useful!

Can you find a paper-tape reader with a USB2.0 interface? I used to
have boxes of Hollerith cards with interesting things punched in them.
I don't any more, and even if I did there's no way I could read them.

-- 
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov
0
Slattery_T (112)
10/4/2004 12:53:40 PM
Reply:

Similar Artilces:

Strange Output
Hello, everybody !!! Why this fragment of code shows : ac cout<<"a\??/??/bc"; Thanks All !!! "Alex Dmitriev" <firejump@mail.ru> wrote in message news:ecTgPp8pEHA.3800@TK2MSFTNGP14.phx.gbl... > Hello, everybody !!! > Why this fragment of code shows : ac > > cout<<"a\??/??/bc"; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccelng4/html/elconTrigraphs.asp '??/' is a '\' so you end up with "a\\\bc" http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vccelng4/html/elc...

Excel Object showing strange behavior
Hello, I have a sheet that I created that contains an Excel object (small spreadsheet) that when double clicked, will open up and allow it to be populated. After they populate it, and close it,...the data is automatically reflected in the object on the original sheet. This is shared with everyone and it's working great. BUT.....(always the but) Why have a few people sent the form back to me saying that when they double click the object it opens up a "Format Object" dialogue box rather than the editable sheet that it was supposed to do? They sent it back to me and sure enough...

Can I format cells when outputting to excel?
Hi I am making an excel report from access using the following: DoCmd.TransferSpreadsheet acExport, _ acSpreadsheetTypeExcel9, "QUERY NAME", _ "C:\FILE LOCATION AND NAME - " & sToday & ".xls", True, "SHEET NAME" Is there any way I can format the cells in excel from here. I am thinking background colours, and number / date formats? Stapes Your only option is to use Excel Automation. See whether my July, 2005 "Access Answers" column in Pinnacle Publication's "Smart Access" is enough to get you going. You can downl...

Exchange Permissions--Strange One
Hi by default, domain admins (and ent. admins) are denied "receive as" and "send as" permissions to the mailbox store. additionally, by default, on the exchange advanced tab under the mailbox rights button, domain admins are DENIED Full Mailbox Access. However, if you look at the security tab for each user object, by default domain admins are allowed "send as" and "receive as" permissions. now i know that the "receive as" right is ignored on the ad user object, but i ran a small test. i logged on as a domain admin, opened up the domain admin...

Natural code, Output Code and Domains fields
hi all, I'm about to use crystal report to handle the natural code, output code and domains but I don't know wich table contains these fields. Any help would be welcome. Thanks Alain ...

Strange Email failure error
Can anyone help? Using Outlook 2002 and POP3 mail. I've always been able to send emails to my wife's work email address until this week, when I get this very strange failure notice. "Connected to 213.2.49.230 but greeting failed. Remote host said: 421 reppsrv01.repp.co.uk is not accepting new connections. Please try later I'm not going to try again; this message has been in the queue too long." Does anyone know what the hell this means? thanks -- Google is your Friend Email address deliberately false to avoid spam: gordonATgbpcomputingDOTcoDOTuk www.gbpcomputin...

Very Strange
Hi I have a Word 2007 document. In this I am using 3 different heading styles. I want to use the feature 'Select Text with Similar Formatting' but it is not working. I have 5 headings that are all Title Case, size 10, Times New Roman, Left aligned and Bold there is exactly the same formatting applied to all 5 headings - I even checked the paragraph spacing - all headings are 0pt before and 12pt after. I checked show and hide - everything I repeat everything is the same - can you tell me why oh why will this feature only select 3 of my headings and not the 5???? ...

why this strange result with vlookup
hi i have this formula in a cell =VLOOKUP(A3,'LookUp Data'!A2:O740,2,FALSE) but any time i pick a code from my list items in column A it gives #NA but as soon as i change to a different code it gives the name. any help why My best guess would be a data type mismatch. Looking up text in a column of numbers. When you change the value the type gets converted and the result is returned. Hard to say though based on yoru description. The ohter thig to look for might be blank characters padded at the end of the input. -- HTH... Jim Thomlinson "Amin" wrot...

DestroyWindow ASSERT problem....strange, strange!
Hi I have derived a dialog-class in a DLL (shared MFC) I can construct an object of this class in my app, and when overloading DoModal() and adding an AFX_MANAGE_STATE(AfxGetStaticModuleState( )); call, I can see the CMyDialog dialog. But here is the issue, I have a timer set for a certain time, it posts a message and the dialog has to be killed - so I use CDialog::OnCancel. Then DoModal calls DestroyWindow() - Here a copy of the m_hWnd is made in hWndOrig. #ifdef _DEBUG hWndOrig = m_hWnd; #endif Then m_hWnd gets set to Null by ::DestroyWndow (which calls OnNcDestroy). But later in Dest...

Strange behavior #3
Hello. I use Outlook 2003 with a internal pop/smtp server (Merak). Using Oulook 2003 (it's the case for all users in the company), when we send mails to internal addresses, in the recipient mailbox our address doesn't appear, we are considered as ghost users! But, if on the same PC we use another email client (Outlook express for example), the mail arrives with my address as sender! Does anyone feel a ghostbuster? Thanks by advance. ...

strange Icon
I'm running Office 2007, and always back up my files to a flash drive which I can then open in my laptop. The "Icons" always look normal until today When I backed up an Excel file. The new Icon on the flash drive has a big exclamation mark (!) in the center of it!! I have reviewed the file and can't find anything wrong with it -- have been doing this for years and have never seen this before. Will someone please tell me what this means!! The icon in my "documents and settings", where the file was saved originally is normal. big john This is a cross post wi...

Is this possible to output some special symbol in VC?
hi, all For example, we use SetWindowText("This is the title"); I wonder if we can add a down-side arrow in front fo the text? Or some other symbols which we have in MS Word? Thanks >For example, we use SetWindowText("This is the title"); >I wonder if we can add a down-side arrow in front fo the text? Or some other >symbols which we have in MS Word? You can output any symbols that exist in the font the window is using, but generally the answer is no - not that easily anyway! Briefly, what are you trying to achieve? Dave ...

strange
hi, why if I load Dialog from satelite DLL it display with white background? When from local resources its ok. thanks ...

Strange problems
All, A standalone Exchange 2003 SP2 server acted up the other day and needed to be restated. After the first reboot it only stayed stable for about 10 minutes. After the second, it's been running but generating the errors listed below. I ran the "Performance Troubleshooting Analyzer" and "Troubleshooting Assistant" tools from Microsoft's websites but didn't get anything that was too useful. Any suggestions? Event Type: Warning Event Source: MSExchangeIS Mailbox Store Event Category: General Event ID: 1025 Date: 3/28/2007 Time: 8:44:43 AM User: N/A C...

more than 8192 characters in text file output
SQL 2005 I have a customer that is requiring me to generate INSERT statements (in a tab delimted text file) for him from their existing MSSQL 2005 table for import into an outside MySql system for other purposes. I'm creating the statements for about 10 columns, one of which is TEXT type. Most of the rows contain less than 4000 characters of text in that column but a few exceed that by quite a bit. I've written a query to generate the INSERTS and it runs fine except that we discovered that some lines in the output are being truncated at 8192 characters. I went into Opt...

Too Strange!!
Today I had a user receive a NEW email from another user in the company (it showed up as a new email message and displayed the new email notification message) - the strange thing is, the email had a sent date that was over a month old. She tells me that she remembers receiving this exact same email on the actual send date which was over a month ago. I checked her inbox - which is in her personal folders and there is only one copy of it which has the sent date from a month ago. I've seen this happen before but could never figure it out. It's almost as if an old email turns up ...

strange problem with ON_UPDATE_COMMAND_UI handler
Hi all.. I programmed an application that has a dialog containing a tree ctrl. On that tree ctrl I'm showing a popup menu when user right clicks on it. The problem I'm having is concerning enabling and graying of popup menu items. I have this in BEGIN_MESSAGE_MAP: ON_COMMAND(IDM_NUEVO_PRODUCTO_CONSOLA, OnNuevoProductoConsola) ON_UPDATE_COMMAND_UI(IDM_NUEVO_PRODUCTO_CONSOLA, OnUpdateNuevoProductoConsola) The first strange thing is that OnUpdateNuevoProductoConsola handler is being called when I click on the item, and not when the item is shown Another strange thing, is that if I g...

Strange color "smudge"
A cell in one of the spreadsheets I've been working on has developed a complexion problem! I noticed this afternoon a small smudge of color one of the cells near the top. The color is whatever I select in the Windows "Appearance" box for 3D objects. It looks like someone drew it with a sharpie or something. Just a short vertical line, about an 1/8 inch long in the lower left of the cell. If I change column widths of the column it's in or nearby, or change row height, it will be in a different column or row but in the same position relative to the overall window the spreadshee...

This is very strange....
In Windows Live Mail Desktop, my messages are suddenly coming in as text only, even though I've set up to receive HTML from my safe senders list. Also, my MAPI account has mysteriously lost several folders that I set up to store different styles of messages. This has all occurred within the last day or so. Alt + T, Options, Read tab, uncheck Read all messages in plain text. Alt + V, Layout, Folder pane, check Show Storage folders. Look under Recovered items. -- Ron Sommer MS MVP- Windows Live Mail "robertwnielsen" <robertwnielsen@discussions.microsoft.c...

Strange password error
Hi, I have a strange problem with Money 2004. When I booted my machine, a message popped up saying there was a problem with Money Express (?), then another message saying there was a problem with Money and I had to insert my installation CD. In the mean time I had started up Money. It seemed to open OK, I typed my password in, the file opened, then Money immediately shut itself down. When I reopened Money, it wouldn't recognise the password for my file. I tried reinstalling Money, but it still wouldn't take the password. I checked a backup of my file from my archives & that open...

strange statement in Settings.Designer
Hello! At the end is the complete code for file Settings.Designer.cs I can't understand this statement ((string)(this["NorthwindConnectionString"])); in this NorthwindConnectionString propery public string NorthwindConnectionString { get { return ((string)(this["NorthwindConnectionString"])); } } namespace WindowsApplication1.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDes...

Strange message's in queue
Hay, I am running SBS 2003 with Exchange 2003, this computer connects to the internet through ISA server that resides on another w2k server! Over the past few weeks lots of messages are in the queue that dont seem to be real. Here is some information that I have put together to help; SBS Connector - 0451.com 22 messages to random usernames@0451.COM (INVALID EMAIL) from postmaster@disability-federation.ie SBS Connector - 0733.com 10 messages to random usernames@0733.COM (INVALID EMAIL) SBS Connector - 006.com - Sender: postmaster@disability-federation.ie - Subject: <Subject Hidden>...

opens to a strange black page
Sometimes, not all the time, when I open Excel I get a blank page. Not a normal blank spreadsheet but a page that is pure white with no 'right click' ability. At the top is the ability to change to a single or multi-page view and a slider for zooming, but no data, no pull-down menus and no way to enter data. If I close the application and restart it, it usually comes up in the normal manner. The blank page does not allow data entry or any modification to it except to scale the window. It is a minor inconvenience but I am geting tired of it. Any ideas? ...

strange?
Why new group?? > Why new group?? Why not? ...

how do i allow fields to be either input or output in excel?
i am trying to build a series of financial calculators in excel. Each has 3-6 fields and 1 output field. What i want to do is allow users the flexibility to leave whichever field blank that they wish and the model will solve for that blank field. so the same model can be used a number of different ways and to solve for any of the possible variables. i see this feature in online calculators but i don't know how to set up my models this way. Any help would be greatly appreciated. Thank u! ...