I am suppose to write a C++ program that reads two C++ program and compares both of them and outputs wether they are copied or not.
But the problem is i dont know where to start from that is i have no lead on the algorthim
one possible solution that came to my mind is that first i will have to use while END of file loop
and read each character one by one from the two program and compare them
however the problem would be for instance
suppose
first file has this line in it
int y = 1;
second file has this line in it
int number = 1;
since both these line mean the same thing how can i use compare them using char only since the variable "y" is not equal to "number"
but the value stored in them is the same
wut can i use here and is their an alternative to use other than char if so please advise
and how should i start making up an algorithm
But the problem is i dont know where to start from that is i have no lead on the algorthim
one possible solution that came to my mind is that first i will have to use while END of file loop
and read each character one by one from the two program and compare them
however the problem would be for instance
suppose
first file has this line in it
int y = 1;
second file has this line in it
int number = 1;
since both these line mean the same thing how can i use compare them using char only since the variable "y" is not equal to "number"
but the value stored in them is the same
wut can i use here and is their an alternative to use other than char if so please advise
and how should i start making up an algorithm
Comment