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.

Empfohlene Antworten

Veröffentlicht

Hallo Zusammen,

ich habe folgenden Programmcode: :mod:

#include <stdio.h>

#include <string.h>

struct telefon

{

char nummer[16];

char adresse[128];

};

struct telefon daten[256];

void main()

{

FILE *f;

char zeile[80];

char tn[16];

char ad[128];

f = fopen("c:\MeineDateien\Telefonauskunft.dat", "r");

while(fgets(zeile, 79, f) != NULL) {

printf("%s", zeile); // schreibt Inhalt in Array *?*

strcpy(daten[16].nummer, tn); // füllt struktur tn

strcpy(daten[128].adresse, ad); // füllt struktur ad

}

fclose(f);

}

ich bekomme immer eine Fehlermeldung:

debug assertion failed

File: fgets.c

Line 60

Expression str != NULL

Nur: die Datei gibt es nicht auf meinem Rechner...was is falsch oder kann man sowas unterdrücken??

Help!

Flöckchen :StefanE

Hi..

in der fopen Zeile oder wo meinst du das mit den \\ ?

Ciao und Danke :)

SF :StefanE

Originally posted by Schneeflocke

Hi..

in der fopen Zeile oder wo meinst du das mit den \\ ?

Ciao und Danke :)

SF :StefanE

In fopen , denn ein einziger \ ist die Einleitung einer Escape-Sequenz. Findet man aber auch in jedem C-Buch wenn man es denn mal liest ;-).

Frank

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.