Relatively new to c++.
Trying to figure out how to add zero's and one's to to the front of my signed binary string.
can anyone let me know where this code is going wrong? output is coming back as 0.
string signed_extension(string s) {
// you implement this one first
char arr[16] = "";
int len = 16 - strlen(arr);
memmove(arr + len, arr, strlen(arr));
for (int i = 0; i < len; i++)
if (s[0] = 0)
{
arr[i] = '0';
}
else
{
arr[i] = '1';
}
return "0";
}