Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

char* gen_10_bits(int len){
	int i;
	char* bit_s;

	bit_s = (char *)malloc(sizepf(char)*len);

	for(i=0; i < len; i++){
		bit_s[i] = i%2 == 0 ? '1':'0'
	}

	return bit_s
}

char* gen_01_bits(int len){
	int i;
	char* bit_s;

	bit_s = (char *)malloc(sizepf(char)*len);

	for(i=0; i < len; i++){
		bit_s[i] = i%2 == 0 ? '1':'0'
	}

	return bit_s
}

int hamm_dist(char *s0, const char *s1, const char * s2){
	int n;

	if(!*s1 && !*s2){
		*s0 = '\0';
		return 0;
	}
	
	if(!*s1 || !*s2 || (n = func(s0 + 1, s1 + 1, s2 + 1)) == -1) return -1;
	if(*s1 == *s2) *s0 = ' ';
	else{
		*s0 = '|';
		++ n;
	}
	return n;
}
 
int main(void){
	int N;
	int A,B;
	int i;
	int flag_msb_0 = 0;
	int res1,res2;

	int N[1000000];
	int s[1000000];
 
 	scanf("%s", list);

 	/*
 	if(list[0] == '0'){
 		flag_msb_0 = 1;
 	}
 	*/

 	res1 = hamm_dist(gen_01_bits, N);
 	res2 = hamm_dist(gen_10_bits, N);

 	if(res1 > res2){
		printf("%d\n", res1);
	}else{
		printf("%d\n", res2);
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'char* gen_10_bits(int)':
a.cc:9:39: error: expected primary-expression before 'char'
    9 |         bit_s = (char *)malloc(sizepf(char)*len);
      |                                       ^~~~
a.cc:9:32: error: 'sizepf' was not declared in this scope; did you mean 'size_t'?
    9 |         bit_s = (char *)malloc(sizepf(char)*len);
      |                                ^~~~~~
      |                                size_t
a.cc:12:46: error: expected ';' before '}' token
   12 |                 bit_s[i] = i%2 == 0 ? '1':'0'
      |                                              ^
      |                                              ;
   13 |         }
      |         ~                                     
a.cc:15:21: error: expected ';' before '}' token
   15 |         return bit_s
      |                     ^
      |                     ;
   16 | }
      | ~                    
a.cc: In function 'char* gen_01_bits(int)':
a.cc:22:39: error: expected primary-expression before 'char'
   22 |         bit_s = (char *)malloc(sizepf(char)*len);
      |                                       ^~~~
a.cc:22:32: error: 'sizepf' was not declared in this scope; did you mean 'size_t'?
   22 |         bit_s = (char *)malloc(sizepf(char)*len);
      |                                ^~~~~~
      |                                size_t
a.cc:25:46: error: expected ';' before '}' token
   25 |                 bit_s[i] = i%2 == 0 ? '1':'0'
      |                                              ^
      |                                              ;
   26 |         }
      |         ~                                     
a.cc:28:21: error: expected ';' before '}' token
   28 |         return bit_s
      |                     ^
      |                     ;
   29 | }
      | ~                    
a.cc: In function 'int hamm_dist(char*, const char*, const char*)':
a.cc:39:33: error: 'func' was not declared in this scope
   39 |         if(!*s1 || !*s2 || (n = func(s0 + 1, s1 + 1, s2 + 1)) == -1) return -1;
      |                                 ^~~~
a.cc: In function 'int main()':
a.cc:55:13: error: conflicting declaration 'int N [1000000]'
   55 |         int N[1000000];
      |             ^
a.cc:49:13: note: previous declaration as 'int N'
   49 |         int N;
      |             ^
a.cc:58:21: error: 'list' was not declared in this scope
   58 |         scanf("%s", list);
      |                     ^~~~
a.cc:66:25: error: cannot convert 'char* (*)(int)' to 'char*'
   66 |         res1 = hamm_dist(gen_01_bits, N);
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~
      |                         |
      |                         char* (*)(int)
a.cc:31:21: note:   initializing argument 1 of 'int hamm_dist(char*, const char*, const char*)'
   31 | int hamm_dist(char *s0, const char *s1, const char * s2){
      |               ~~~~~~^~
a.cc:67:25: error: cannot convert 'char* (*)(int)' to 'char*'
   67 |         res2 = hamm_dist(gen_10_bits, N);
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~
      |                         |
      |                         char* (*)(int)
a.cc:31:21: note:   initializing argument 1 of 'int hamm_dist(char*, const char*, const char*)'
   31 | int hamm_dist(char *s0, const char *s1, const char * s2){
      |               ~~~~~~^~