Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Newline 0x0a statt 0x0d0a

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe ein Problem in C++ (Microsoft Visual Studio 2008), und weis nach Stunden immer noch nicht weiter:

Ich muss einen Zeilenumbruch im Unix-Stil (also 0x0a statt 0x0d0a) ausgeben

-

aber auch wenn ich in der Zeile

cout<<"Hallo Welt\xA";

schreibe,

bekomme ich dann in der Ausgabe (per Hexeditor angeschaut) ein normales 0x0d0a zu Gesicht.

Gibt es da irgendeine Möglichkeit, das in einen Modus umzuschalten, wo nicht so intelligent gedacht wird?

Danke,

tsg

Ja, du musst die Streams auf Binärmodus schalten.

Da ich aber gerade nicht weiß, wie man den Modus von offenen Streams ändert, könnte dir evtl. folgendes helfen:

Formatted output

These member functions interpret and format the data to be written as sequences of characters. These type of operation is performed using member and global functions that overload the insertion operator (operator<<).

Unformatted output

Most of the other member functions of the ostream class are used to perform unformatted output operations, i.e. output operations that write the data as it is, with no formatting adaptations. These member functions can write a determined number of characters to the output character sequence (put, write) and manipulate the put pointer (seekp, tellp).

von hier ostream - C++ Reference

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.