i make a program to multiply 2 binarry numbers
#include <iostream>
#include<string>
using namespace std;
void main()
{
string y,a;
string S1="00000";
cout<<"plz ener two numbers"<<endl;
cin>>y;
cin>>a;
cout << "Sting S1\t\t" << S1 << endl;
cout << "S1.size\t\t\t" << S1.size() << endl;
int n=a.length();
n=a[4];
if(n[4]==0)
{
string S2=a;
S2=S1+S2;
S2>>=1;
S1= S2.substr ( 0,4);
a= S2.substr ( 5,9);
}
else
{
S1+=y;
string S2=a;
S2=S1+S2;
S2>>=1;
S1= S2.substr ( 0,4);
a= S2.substr ( 5,9);
}
}
but the following errors appear to me
1>------ Build started: Project: 111, Configuration: Debug Win32 ------
1>Compiling...
1>111.cpp
1>c:\documents and settings\ahmed hassan\my documents\visual studio 2008\projects\111\111\111.cpp(15) : error C2109: subscript requires array or pointer type
1>c:\documents and settings\ahmed hassan\my documents\visual studio 2008\projects\111\111\111.cpp(19) : error C2676: binary '>>=' : 'std::string' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\documents and settings\ahmed hassan\my documents\visual studio 2008\projects\111\111\111.cpp(28) : error C2676: binary '>>=' : 'std::string' does not define this operator or a conversion to a type acceptable to the predefined operator
1>Build log was saved at "file://c:\Documents and Settings\Ahmed Hassan\My Documents\Visual Studio 2008\Projects\111\111\Debug\BuildLog.htm"
1>111 - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========