project to convert

closed account (GvMiNwbp)
Hi, I'm a new member here and I want a person who can help me with a project.

I am a beginner in C ++ two months I practice . For example, I made ​​a "tic tac toe " or simple progrmmes as " palindrome " . but today I have made ​​a program to convert the unicode UF8 and 16 but I do not understand.

I 'd like someone to mentor me and follow the project with me. Or if the person could do the program in utf8 for me to understand and I make utf 16.

I know how to do the calculations but not program it.

excuse me for my English
Last edited on
closed account (GvMiNwbp)
thank you for your link but I really struggle to succeed... :/
I have that for the moment :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
void print(int t[NB_BITS])
{ 
	int i;
	for(i=0; i<NB_BITS; i++){
		cout << t[i];
		if ((i+1)%4==0){
			cout << " ";
		}
	}
}

void convert(int n, int test[NB_BITS]){

	int i=NB_BITS-1, res;
	
	if (n<0){
		test[0]=1;
		n=-n;
	} else test[0]=0;
		
	for(i;i>0;i--){
		
		res=n%2;
		n=n/2;
		test[i]=res;
		
	}
}
it's good ?
thank
Last edited on
Topic archived. No new replies allowed.