Write your question here.
this is an incomplete code , what it should do is ask to input 2 .TXT files which are arrays, normalize them(take their norm) then integrate their product.
i am not sure how to write code asking to take the norm of the 2 .txt files , and i also keep getting too many errors.
First things first, after your include statements, put 'using namespace std;'
It will make it easier, so you don't have to use std:: all the time.
For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <vector>
usingnamespace std; // This will stop the 'std::'
int main()
{
// code here
// Instead of this
std::cout << "Hello World!" << endl;
// You can just do this
cout << "Hello World!" << endl;
return 0;
}
First things first, after your include statements, put 'using namespace std;'
It will make it easier, so you don't have to use std:: all the time.
Less keystrokes makes for happier programmers.
No, don't do that !
What that does is bring in the entire std namespace to the global namespace, defeating the purpose of namespaces - that is causing clashes with variable & function names. There are all kinds of variables that will clash like count, distance, left, right, merge, ratio plus many others. Instead of worrying about whether a name will clash, just put std:: before each std thing, as the OP has done.
Ideally one should put their own stuff in it's own namespace.
@ashash
What do you mean by normalize? I can think of a few different meanings for that.