我需要编写我的函数strtok。下面是我的代码。问题是 - 我无法显示结果字符串。在我使用的代码中strcpy(),然后显示新数组。是否可以仅使用指针显示字符串*str?
#include <stdio.h>
#include <string.h>
char* my_strtok(char* s, char* delm){
char W[100];
int i = 0, k = 0, j = 0;
char *ptr;
static char *Iterator;
ptr = s;
if (s == NULL){
s = Iterator;
}
while (s[i] != '\0'){
j = 0;
while (delm[j] != '\0'){
if (s[i] != delm[j])
W[k] = s[i];
else goto It;
j++;
}
ptr++;
i++;
k++;
}
It:
W[i] = 0;
Iterator = ++ptr;
return W; …Run Code Online (Sandbox Code Playgroud) 是否有可能在Linux内核中划分并使用双值?当我尝试:
typedef struct{
...
long long int sbe;
...
} connection;
hook_func(){
connection* found
...
uint32_t time_misec ..
uint32_t bytes_diff ..
...
double be = bytes_diff / time_misec;
found->sbe = be / 2 + found->sbe / 2;
...
}
Run Code Online (Sandbox Code Playgroud)
我有错误:
WARNING: "__fixunsdfsi" [/home/kir/netfilter/hello.ko] undefined!
WARNING: "__adddf3" [/home/kir/netfilter/hello.ko] undefined!
WARNING: "__floatdidf" [/home/kir/netfilter/hello.ko] undefined!
WARNING: "__muldf3" [/home/kir/netfilter/hello.ko] undefined!
WARNING: "__floatunsidf" [/home/kir/netfilter/hello.ko] undefined!
Run Code Online (Sandbox Code Playgroud)