الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

قراءة وكتابة الملفات

بدأه Rashid85 في 15 أكتوبر 2010 · 6 رد · 606 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

برجاء من يستطيع المساعدة في هذه المسائل. وجزاكم الله خيرا.

1- write a program that prompts a user for a filename of an existing file that contains 10 lines of student names. next the program reads the filename reads the contents of the file byte by byte and writes them to an new output file.

========================

2- write a program that prompts a user for a filename of an existing file that contains 10 records where the length of each record is 12 characters. next the program seeks to the beginning of the 6th record, reads the records in the file and append them to the end of an existing output file that contains 3 records.

========================

3- write a program to read a series of 10 names, one per line, from a standard input, and write out those names to file1, then:

a- the program reads the content of file1 from end to beginning (reverse order) byte by byte and writes them to file2.

b- the program reads the content of file 2 from end to beginning (reverse order) byte by byte and writes them to the standard output.

#2

اين محاولاتك.....؟

ممكن ارفع لك ملف به بعض البرامج لا بأس بها

ممكن ان تذاكرها....و من ثثم تستطيع حل واجبك :)

00020309t.gif

1958_1963.gif
#3

نرجو المحاولة

و ارسال المحاولة

ثم نساعدك

فهذا المنتدى ليس لحل واجبات الطلبة :D:D

#4

يا أخي يجب أن تضع محاولاتك كما نوه الإخوه...

على العمود .... هذه تصلح إجابه للسؤال الأول..

#include <iostream>
#include <fstream>

using namespace std;

void copy(ifstream&, ofstream&);

int main(void)
{
	char filename[50];
	ifstream fromStream;
	ofstream toStream;

	cout << "Enter a file name: ";
	cin.getline(filename, 50);

	fromStream.open(filename, fstream::in);
	toStream.open("target.txt", fstream::out);

	copy(fromStream, toStream);

	fromStream.close();
	toStream.close();

	return 0;
}

void copy(ifstream &frmStream, ofstream &toStream)
{
	int i;
	while ( (i=frmStream.get()) != -1)
    	toStream.put(i);
}
#5

الملف..طبعا هو لا يؤدى المطلوب و لكن للفائدة

files.doc

1
00020309t.gif

1958_1963.gif
#6

شكرا أخواني TheBigBiss و هويدي

و شكر خاص ل نفرتاري

تم تعديل هذه المشاركة بواسطة Rashid85 في 15 أكتوبر 2010 في 20:08

#7

ممكن تبقى تجرب البرامج و تعرضها هنا .... و احنا نساعدك ان شاء الله :)

00020309t.gif

1958_1963.gif

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…