Turkiye'nin Bilişim Portalı  

C++ Programlama - .txt(Not Defterine) Kayıt Yapmak

This is a discussion on C++ Programlama - .txt(Not Defterine) Kayıt Yapmak within the Programlama forums, part of the Yazılım Forum category; Kod: 1. #include <iostream.h> 2. #include <conio.h> 3. #include <fstream.h> ...


Geri git   Turkiye'nin Bilişim Portalı > Yazılım Forum > Programlama

Kayıt ol Blogs Yardım Üye Listesi Ajanda Arama Bugünki Mesajlar Bütün Forumları okunmuş kabul et
FPSS slide image

Heavy Rain'den Yeni Resimler

PlayStation 3'ün en önemli oyunları arasında yer alan ve görselliğinin kaliteli ...

Read more...
FPSS slide image

Resistance 2 Kapak Seçimi

Resistance 2: Collector's Edition için tasarlanan üç farklı kapak tasarımı yayınlandı. Bunlardan hangisinin seç...

Read more...
FPSS slide image

Facebook Mu MySpace Mi? Yarış Kızışıyor!

Facebook mu MySpace mi? Yarış kızışıyor!
ComScore'un yaptığı araştırmaya gö...

Read more...
FPSS slide image

Nvidia'da Gözler Yeni Sürücülere Çevrildi

Nvidia'da Gözler Yeni Sürücülere Çevrildi

Nvidia cephesinden hem GeForce 9800...

Read more...
FPSS slide image

Nvidia GeForce 177.35 WHQL Sürücüsünü Kullanıma Sundu

Nvidia, 177.35 sürüm numaralı ve WHQL sertifikalı yeni GeForce sürücüsü kullanı...

Read more...
  #1 (permalink)  
Alt 03-07-2009, 14:08:09
Burak - ait Kullanıcı Resmi (Avatar)
Direktor
 
Üyelik tarihi: May 2008
Mesajlar: 313
Blog Entries: 1
Burak - MSN üzeri Mesaj gönder
Standart C++ Programlama - .txt(Not Defterine) Kayıt Yapmak

Kod:
   1. #include   <iostream.h>
   2. #include   <conio.h>
   3. #include   <fstream.h>
   4. #include <iomanip.h>
   5.  
   6.  
   7. int gun,ay,yil,biz,onlar,kontrol=0;
   8. char saha;
   9.  
  10. void kayit()
  11. {
  12. int kayitSayisi,i;
  13. cout<<"dosyaya kac kayit yapilacak ?"<<endl;
  14.  cin>>kayitSayisi;
  15. ofstream futbol;
  16. futbol.open("skor.txt",ios::out);
  17. for(i=0;i<kayitSayisi; i++)
  18. {
  19. cout<< " verileri giriniz ?"<<endl;
  20. cin>>gun>>ay>>yil>>saha>>biz>>onlar;
  21. futbol << gun<<setw(3)<<setw(3)<<ay<<setw(3)<<yil<<setw(3)<<saha<<setw(3)<<biz<<setw(3)
  22.		<<onlar<<setw(3)<<endl;
  23. }
  24. futbol.close();
  25. getch();
  26. }
  27.  
  28.  
  29.  
  30. void kayitIlave()
  31. {
  32. int ilaveKayit,i;
  33. cout<<"dosyaya kac kayit ilave edilecek ?"<<endl;
  34.  cin>>ilaveKayit;
  35. ofstream futbol;
  36. futbol.open("skor.txt",ios::app);
  37. for(i=0;i<ilaveKayit; i++)
  38. {
  39. cout<< " verileri giriniz ?"<<endl;
  40. cin>>gun>>ay>>yil>>saha>>biz>>onlar;
  41. futbol << gun<<ay<<yil<<saha<<biz<<onlar<<endl;
  42. }
  43. futbol.close();
  44. getch();
  45. }
  46.  
  47. void liste()
  48. {
  49. clrscr();
  50. ifstream futbol;
  51. futbol.open("skor.txt",ios::in);
  52. while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar)
  53. {
  54. cout<< gun<<ay<<yil<<saha<<biz<<onlar<<endl;
  55. cout<endl;
  56.  }
  57. futbol.close();
  58. getch();
  59. }
  60.  
  61. void silme()
  62. {
  63. int silinecekYil;
  64. clrscr();
  65. cout<<"silinecek yil giriniz "<<endl;
  66.  cin>>silinecekYil;
  67. ifstream futbol;
  68. futbol.open("skor.txt",ios::in);
  69. ofstream gecici;
  70. gecici.open("gecici.txt",ios::out);
  71. while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar)
  72. {
  73. if(silinecekYil!=yil)
  74. {
  75.  gecici << gun<<ay<<yil<<saha<<biz<<onlar<<endl;
  76.  }
  77.  }
  78.  
  79.  
  80. futbol.close();
  81. gecici.close();
  82.  
  83.   // copy temp to milan
  84.   ifstream f1("gecici.txt");
  85.   ofstream f2("skor.txt");
  86.   f2<<f1.rdbuf();
  87.  
  88. }  
  89.  
  90.  
  91. void sorgu()
  92. {int yilAra;  
  93. cout<<"hangi yila ait kayitlari araniyor ?"<<endl;
  94.  cin>>yilAra;
  95. ifstream futbol;  
  96. futbol.open("skor.txt",ios::in);
  97. while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar )  
  98. {  
  99. if(yilAra==yil)  
100. cout<<   gun<<ay<<yil<<saha<<biz<<onlar<<endl;
101. }
102. futbol.close();  
103. getch();  
104. }  
105.  
106.  
107. void menu()  
108. {  
109. int secim;  
110. clrscr();  
111. while(kontrol==0)  
112. {  
113. cout<<"[1] - Kayit " <<endl;
114.  cout<<"[2] - Kayit Ilave " <<endl;
115.   cout<<"[3] - Silme " <<endl;
116.	cout<<"[4] - Liste " <<endl;
117.	 cout<<"[5] - sorgu " <<endl;
118.	  cout<<"[6] - Cikis " <<endl;
119.	   cout<<"Seciminiz:"<<endl;
120.		cin>>secim;  
121. if(secim==1) kayit();  
122. if(secim==2) kayitIlave();  
123. if(secim==3) silme();  
124. if(secim==4) liste();  
125. if(secim==5) sorgu();  
126. if(secim==6) kontrol=1;  
127. else menu();  
128. }  
129. }  
130. void main()  
131. {  
132. menu();  
133. }  Ekleyen : afish

CODE
1. #include   <iostream.h>
   2. #include   <conio.h>
   3. #include   <fstream.h>
   4. #include <iomanip.h>
   5.  
   6.  
   7. int gun,ay,yil,biz,onlar,kontrol=0;
   8. char saha;
   9.  
  10. void kayit()
  11. {
  12. int kayitSayisi,i;
  13. cout<<"dosyaya kac kayit yapilacak ?"<<endl;
  14.  cin>>kayitSayisi;
  15. ofstream futbol;
  16. futbol.open("skor.txt",ios::out);
  17. for(i=0;i<kayitSayisi; i++)
  18. {
  19. cout<< " verileri giriniz ?"<<endl;
  20. cin>>gun>>ay>>yil>>saha>>biz>>onlar;
  21. futbol << gun<<setw(3)<<setw(3)<<ay<<setw(3)<<yil<<setw(3)<<saha<<setw(3)<<biz<<setw(3)
  22.		<<onlar<<setw(3)<<endl;
  23. }
  24. futbol.close();
  25. getch();
  26. }
  27.  
  28.  
  29.  
  30. void kayitIlave()
  31. {
  32. int ilaveKayit,i;
  33. cout<<"dosyaya kac kayit ilave edilecek ?"<<endl;
  34.  cin>>ilaveKayit;
  35. ofstream futbol;
  36. futbol.open("skor.txt",ios::app);
  37. for(i=0;i<ilaveKayit; i++)
  38. {
  39. cout<< " verileri giriniz ?"<<endl;
  40. cin>>gun>>ay>>yil>>saha>>biz>>onlar;
  41. futbol << gun<<ay<<yil<<saha<<biz<<onlar<<endl;
  42. }
  43. futbol.close();
  44. getch();
  45. }
  46.  
  47. void liste()
  48. {
  49. clrscr();
  50. ifstream futbol;
  51. futbol.open("skor.txt",ios::in);
  52. while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar)
  53. {
  54. cout<< gun<<ay<<yil<<saha<<biz<<onlar<<endl;
  55. cout<endl;
  56.  }
  57. futbol.close();
  58. getch();
  59. }
  60.  
  61. void silme()
  62. {
  63. int silinecekYil;
  64. clrscr();
  65. cout<<"silinecek yil giriniz "<<endl;
  66.  cin>>silinecekYil;
  67. ifstream futbol;
  68. futbol.open("skor.txt",ios::in);
  69. ofstream gecici;
  70. gecici.open("gecici.txt",ios::out);
  71. while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar)
  72. {
  73. if(silinecekYil!=yil)
  74. {
  75.  gecici << gun<<ay<<yil<<saha<<biz<<onlar<<endl;
  76.  }
  77.  }
  78.  
  79.  
  80. futbol.close();
  81. gecici.close();
  82.  
  83.   // copy temp to milan
  84.   ifstream f1("gecici.txt");
  85.   ofstream f2("skor.txt");
  86.   f2<<f1.rdbuf();
  87.  
  88. }  
  89.  
  90.  
  91. void sorgu()
  92. {int yilAra;  
  93. cout<<"hangi yila ait kayitlari araniyor ?"<<endl;
  94.  cin>>yilAra;
  95. ifstream futbol;  
  96. futbol.open("skor.txt",ios::in);
  97. while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar )  
  98. {  
  99. if(yilAra==yil)  
100. cout<<   gun<<ay<<yil<<saha<<biz<<onlar<<endl;
101. }
102. futbol.close();  
103. getch();  
104. }  
105.  
106.  
107. void menu()  
108. {  
109. int secim;  
110. clrscr();  
111. while(kontrol==0)  
112. {  
113. cout<<"[1] - Kayit " <<endl;
114.  cout<<"[2] - Kayit Ilave " <<endl;
115.   cout<<"[3] - Silme " <<endl;
116.	cout<<"[4] - Liste " <<endl;
117.	 cout<<"[5] - sorgu " <<endl;
118.	  cout<<"[6] - Cikis " <<endl;
119.	   cout<<"Seciminiz:"<<endl;
120.		cin>>secim;  
121. if(secim==1) kayit();  
122. if(secim==2) kayitIlave();  
123. if(secim==3) silme();  
124. if(secim==4) liste();  
125. if(secim==5) sorgu();  
126. if(secim==6) kontrol=1;  
127. else menu();  
128. }  
129. }  
130. void main()  
131. {  
132. menu();  
133. }
Alıntı
__________________
TrBil@Forum

BuRaK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Alıntı ile Cevapla
Cevapla

Seçenekler
Stil

Yetkileriniz
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodları Kapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık


Bütün Zaman Ayarları WEZ +3 olarak düzenlenmiştir. Şu Anki Saat: 21:54:11 .


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC7
Copyright ©2007 - 2008 WwW.Trbil.CoM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66