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.

Simples Problem !!! Zeilenwechsel!!!

Empfohlene Antworten

Veröffentlicht

Hallo!

Habe ein ganz simples Problem, jedoch keine Ahnung warum?

Und zwar öffne ich mir ne Datei, und füge eine Zeile ans Ende.

Ich schließe die Datei wieder!!!

Beim nächsten Öffnen der Datei schreibt er nicht in eine neue Zeile, sondern schreibt immer hinter die letzte Zeile!!!

Wie kann ich denn bezwecken, daß er ne neue Zeile beginnt?

Habe \n usw. schon ausprobiert???

p[strlen(p)-1]='\0';

input = fopen (file, "a+");

strcpy (message1, " ");

strcpy (message2, " ");

strcpy (message3, " ");

strcpy (message4, " ");

v = strcpy (message1, p);

sprintf(b,"%d.",Teilegut);

strcat(v , message2);

strcat(v , B); sprintf(b,"%d.",Teileschlecht);

strcat(v , message3);

strcat(v , B);

sprintf(b,"%d.",Teilegep);

strcat(v , message4);

strcat (v, B);

fputs (v, input);

fclose (input);

Danke für Eure Hilfe

Du mußt auch einen LineEnd code schreiben. Auf Windows wäre das ein Byte mit 0x0d und ein Folgebyte mit 0x0a .

mfg

Kristian

em ich glaube da gabe es was mit \n

jedoch weis ich nicht ob es in diesem zusammenhang funtzt

Ich nutz eigendlich meistens

WORD EndCode = 0x0a0d // umgekehrte Reihenfolge da Intel Byte Order

..

fwrite(&EndCode, 2, filePointer);

..

für Unicode natürlich ein DWORD (0x0a000d00)

mfg

Kristian

PS : es gibt auch nur 0x0a, jedoch nicht von jedem Program einwandfrei interpretiert. Das wird von \n erzeugt. (Sorry die vielen Änderungen)

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.