#include<stdio.h> #include #include #include class student { private: char ch; int counter,counterf,counterc; public: student() { counter=0; counterf=0; counterc=0; } void copy_int() { fstream obj1; obj1.open("number.cpp",ios::in); obj1.get(ch); while(!obj1.eof()) { if(ch=='"') { obj1.get(ch); while(ch!='"') { obj1.get(ch); } } if(ch=='i') { obj1.get(ch); if(ch=='n') { obj1.get(ch); if(ch=='t') { obj1.get(ch); if(ch==' ') { obj1.get(ch); while(ch!=';') { obj1.get(ch); if(ch==',') counter++; else continue; } counter++; } } } } obj1.get(ch); }
cout<<"THE NUMBER OF INTEGER VARIABLES"<
}
}
}
} } obj1.get(ch); } cout<<"THE NUMBER OF FLOAT VARIABLES"<
fstream obj1; obj1.open("number.cpp",ios::in); obj1.get(ch); while(!obj1.eof()) { if(ch=='"') { obj1.get(ch); while(ch!='"') { obj1.get(ch); } } if(ch=='c') { obj1.get(ch); if(ch=='h') { obj1.get(ch); if(ch=='a') { obj1.get(ch); if(ch='r') { obj1.get(ch); if(ch==' ') { obj1.get(ch); while(ch!=';') { obj1.get(ch); if(ch==',') counterc++; else continue; } counterc++; } } } } } obj1.get(ch); } cout<<"number of char variables"<
}; void main() { student object; object.copy_int(); object.copy_float(); object.copy_char(); }