+ 1

How can I make a memory diagram for a c++code?

I had never made a memory diagram before can anyone help me? Please its urgent! //Given is a c++ Program to search a name of student from a file. //I have more task Please help me in this one only! #include<iostream> #include<fstream> #include<string> using namespace std; int main() { string line; char name_of_student[1000]; int offset; ifstream Myfile; Myfile.open("Names of Students.txt"); cout << "Enter the name to search from the respective file : \n"; cin.getline(name_of_student , 1000); if (Myfile.is_open()) { while (!Myfile.eof()) { getline(Myfile,line); if ((offset = line.find(name_of_student, 0)) != string::npos) { system("CLS"); cout << "\n\n\t\t Congratulations!\n\tThe name " << name_of_student << " have been found!\n\n\n\n"; break; } } } Myfile.close(); }

9th Jun 2020, 1:39 PM
Ja Asim
Ja Asim - avatar
1 Resposta