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

Hey leute,

ich wollte in einer consolenanwendung von mir dafür sorgen, das eine textdatei erstellt wird und beschrieben wird. Habe dazu im internet ein wenig rum gesucht und das hier ausprobiert:

#include <cstdlib>

#include <iostream>

#include <stdio.h>



using namespace std;


int main()

{

    FILE* fb;

    char str[20], zeile[80];


    fb = fopen("triplejo.txt"), "w";

    fprintf(fb, "Hallo!");

    fclose(fb);

    system("PAUSE");

    return EXIT_SUCCESS;

}
nur werden 2 fehlermeldungen angezeigt einmal hier:
_CRTIMP FILE* __cdecl fopen (const char*, const char*);
und zwar 178 D:\Programme\Dev-Cpp\include\stdio.h too few arguments to function `FILE* fopen(const char*, const char*)' und hier:
    fb = fopen("triplejo.txt"), "w";

mit 13 C:\Dokumente und Einstellungen\Johannes\Desktop\mainsadf.cpp at this point in file

es scheint ja mt einander zusammen zuhängen...

Desweiteren fällt mir auf das gar nicht angegeben wird wo sie erstellt werden soll... (War so auf ner seite als beispiel gegeben)

deswegen wird das sowieso ganz falsch sein :(

Wäre schön wenn ja das ihr mir dann bitte helft den richtigen code zubasteln!!

MfG Artery

  • Autor

also auf der seite versteh ich fast nur bahnhof grrr.. (liegt nicht am englisch :P )

also hab noch fast keine ahnung von c und so

deswegen könntest du mir das näher erläutern und evt. nen beispiel geben?

Ich möchte nur das eine Textdatei z.b. auf dem desktop erstellt wird und darin ein bisschen text steht und der inhalt von ein paar Variablen...

Wäre nett wenn dus mir zeigen würdest.

MfG Artery

    fb = fopen("triplejo.txt"), "w";

Die Fehlermeldung sagt doch eigentlich schon alles aus: schau Dir mal die Position der schließenden Klammer genau an ;)

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.