We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39ac941 commit 283b251Copy full SHA for 283b251
byte_order.c
@@ -0,0 +1,30 @@
1
+#include <stdlib.h>
2
+#include <stdio.h>
3
+
4
+// 65535
5
+// 32767
6
7
+char *generate_buffer(int num) {
8
+ char *buffer = malloc(num * 7 + 1);
9
+ int i;
10
11
+ for(i = 0; i < num; i++) {
12
+ buffer[(i*7)] = 40000;
13
+ buffer[(i*7 + 2)] = 1;
14
+ buffer[(i*7 + 6)] = 'a';
15
+ }
16
+ buffer[(num * 7)] = '\0';
17
+ return buffer;
18
+}
19
20
+int main(int argc, char* argv[]) {
21
+ char *buf = generate_buffer(1);
22
23
+ for (i = 0; i < 8; i++)
24
+ {
25
+ if (i > 0) printf(":");
26
+ printf("%02X", buf[i]);
27
28
+ printf("\n");
29
+ return 0;
30
0 commit comments