Jump to content
ELFORUM - Forumul electronistilor

Problema cu fisier txt


satelit

Recommended Posts

Vreau sa fac un program in C care sa creeze un fisier txt si sa imi puna informatia pe coloane nu pe linii.Eu am facut unul simplu care scrie un string pe linii :char msg[]="salut";FILE* f = fopen("TEST.txt", "w");for (int i=0;i<10;i++) {fwrite(msg, strlen(msg), 1, f); } fclose(f);Acest program creeaza un fisier TEST.txt si scrie de 9 ori salut ,dar le scrie pe o linie,eu vreau sa-mi scrie pe o coloana.Daca vreti sa ma ajutati si pe mine.Va multumesc

Link to comment
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • satelit

    3

  • ghimpe--

    2

  • Cristiano

    1

  • radue

    1

Top Posters In This Topic

Cu newline nu merge,eu programul vreau sa-l fac in c++builder si nu toate functiile din c/c++ sunt compatibile cu c++builder.O varianta ar fi cu array dar nu prea stiu sa-l implementez.

Link to comment

"\n" parca reprezinta "caracterul" care delimiteaza sfarsitul unui rand de inceputul celuilalt. Deci el nu inseamna "new line" ci "end of line". :smt003

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines