windows server
1.Open cmd as administrator
2.route delete 224.0.0.0 mask 240.0.0.0
3.route add 224.0.0.0 mask 240.0.0.0 <IP of NIC>
VLC version 2.26
使用UDP 打流
#include <stdio.h>
int main()
{
printf ("Characters: %c %c \n", 'a', 65);
printf ("Decimals: %d %ld\n", 1977, 650000L);
printf ("Preceding with blanks: %10d \n", 1977);
printf ("Preceding with zeros: %010d \n", 1977);
printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
printf ("Width trick: %*d \n", 5, 10);
printf ("%s \n", "A string");
return 0;
}
Characters: a A
Decimals: 1977 650000
Preceding with blanks: 1977
Preceding with zeros: 0000001977
Some different radixes: 100 64 144 0x64 0144
floats: 3.14 +3e+000 3.141600E+000
Width trick: 10
A string
http://ccckmit.wikidot.com/cp:sscanf
#include <stdio.h>
int main() {
char name[20], tel[50], field[20], areaCode[20], code[20];
int age;
sscanf("name:john age:40 tel:082-313530", "%s", name);
printf("%s\n", name);
sscanf("name:john age:40 tel:082-313530", "%8s", name);
printf("%s\n", name);
sscanf("name:john age:40 tel:082-313530", "%[^:]", name);
printf("%s\n", name);
sscanf("name:john age:40 tel:082-313530", "%[^:]:%s", field, name);
printf("%s %s\n", field, name);
sscanf("name:john age:40 tel:082-313530", "name:%s age:%d tel:%s", name, &age, tel);
printf("%s %d %s\n", name, age, tel);
sscanf("name:john age:40 tel:082-313530", "%*[^:]:%s %*[^:]:%d %*[^:]:%s", name, &age, tel);
printf("%s %d %s\n", name, age, tel);
char protocol[10], site[50], path[50];
sscanf("http://ccckmit.wikidot.com/cp/list/hello.txt",
"%[^:]:%*2[/]%[^/]/%[a-zA-Z0-9._/-]",
protocol, site, path);
printf("protocol=%s site=%s path=%s\n", protocol, site, path);
return 1;
}
其編譯執行結果如下所示。
D:\oc>gcc sscanf.c -o sscanf
D:\oc>sscanf
name:john
name:joh
name
name john
john 40 082-313530
john 40 082-313530
protocol=http site=ccckmit.wikidot.com path=cp/list/hello.txt
%s 可以用%[] 來表示的更精確
^ 表示非的意思
讀到換行符號即停止(換行符並不會從緩衝區讀出)
ex. %[^\n]
*代表忽略相關病讀出緩衝區
用 snprintf / asprintf 取代不安全的 sprintf