Hi, I am trying to write a small program that would permute a list of binary numbers to the nth bits. Some reason, the code is not compiling.
Also, I am using Visual Studio C++ 2010 Express. When i attempt to compile a code, it doesn't highlight where the errors appear like in Xcode. Is there a setting for that? I am a programming noob, so this feature would help me out a lot. Thanks
Here's the code:
#include <iostream>
using namespace std;
void ListBinary(int nBits);
void BinaryPermute(string prefix, int nBits);
int main()
{
ListBinary(3);
cin.get();
return 0;
}
void ListBinary(int nBits)
{
BinaryPermute("", nBits);
}
void BinaryPremute(string prefix, int nBits)
{
if (prefix.length() == nBits)
{
cout << prefix << endl;
}
BinaryPermute(prefix + '0', nBits);
BinaryPermute(prefix + '1', nBits);
}