#include <iostream>
#include <cstring>
using namespace std;
int main(int argc, char* argv[])
{
const char* p = "1111";
int len = strlen(p) - 1;
int a[len];
for(int i = 0; i <= len; i++)
{
a[i] = ~(p[i]- '0');
}
for(int i = 0; i <= len; i++)
{
cout << a[i];
}
}
Why do i get -2 -2 -2 -2 ? I`m not using ~ corect or ?