F=fopen("my file binary","wb")


Download 13.17 Kb.
Sana02.01.2022
Hajmi13.17 Kb.
#194858
Bog'liq
hjgfjydjhhgfgk


#include

#include

using namespace std;

int main()

{

FILE*f;


int n;

char k;


f=fopen("my_file.binary","wb");

cout << "n=";cin>>n;

for(int i=1; i<=n; i++)

{

cin>>k;



fwrite(&k,sizeof(k),1,f);

}

fclose(f);



cout<<"Fayl elementlari"<

f=fopen("my_file.binary","rb");

while(!feof(f))

{

fread(&k,sizeof(k),1,f);



if(!feof(f))

cout<

}

return 0;



}

Download 13.17 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling