Hallo! Habe hier ein kleines Programm, dass einfach eine Zahl in einer Datei speichern soll. Warum klappt es nicht? Es kompiliert richtig, kommt aber dann die Meldung "Fehlerbericht senden", nachdem ich eine Eingabe gemacht habe und diese mit ENTER bestätigte.
1 | #include <cstdlib> |
2 | #include <iostream> |
3 | #include <stdio.h> |
4 | |
5 | int main (void) |
6 | {
|
7 | |
8 | FILE *pFile; |
9 | char read_data; |
10 | char temp; |
11 | |
12 | pFile = fopen("C:\\messwerte.txt", "w"); |
13 | printf ("Zahl eingeben! "); |
14 | scanf ("%d",&temp); |
15 | fwrite(&temp,1,sizeof(temp),pFile); |
16 | fclose(pFile); |
17 | |
18 | |
19 | |
20 | }
|
Danke