#include <iostream>
#include <string>
#include <iomanip>
function validate()
{
var a=documents.forms["yourpasswordfieldname"].value;
var b=documents.forms["yourconfirmpasswordfieldname"].value;
{
if(!(a==b))
{
cout<<"passwords are not matching";
valid=false;
}
else
{
valid=true;
}
}
system("pause");// this will hold the screen so that display can be seen
return 0;
}
var a=documents.forms["yourpasswordfieldname"].value; this is javascript not c++.
Where you have function you would but the return type in this case int since you are returning 0. You will also need a main function with a return type of int.
I would suggest reading up on basic data types and functions before attempting to use them. None the less try and use an arbitrary language mixed with c++. Anyways, you never even defined "valid" so that is another error. You have a bit to learn.
You don't declare variables and functions by declaring them with "var" and "function". You declare variables with their type, and functions with their return type.