我在C中有一个问题逆转字符串(反向行和字母
#include #include #define W 5 #define N 10 void print_(const char[W][N],int); void reverse(char[W][N],int); int main ( ) { char words[W][N] …
打印char多维阵列无法正常工作
#include int main() { FILE *fisier; fisier = fopen("cnp.txt", "r"); int cnpuri = 0; char cnp[10][13]; while(1){ fscanf(fisier, "%s", cnp[cnp…
字符指针的初始化阵列在一个函数中用于主机
如何在函数内初始化字符指针数组。应该注意的是,长度动态地来自函数内部的其他计算。我在 main() 中找不到长度。为了简单起见,我使用 rand() 来解释…
VC2019无法使用CString参数(VC6.0内置)
我有一个旧的 DLL,它是用 VC6.0 构建的。 我想在VC2019项目中使用这个DLL。 这个DLL文件是一个MFC DLL,包含很多类和函数。 除了这三个函数(包含CSt…
C++ std::any 将 std::any 的 C 字符数组转换为字符串的函数
#include #include #include #include #include using namespace std; string AnyPrint(const std::any &value) { cout << size_t(&value) << ", " <<…
实现你自己的 printf
我正在尝试实现C printf,但使用%s ,我使用 {s} 。而不是%d ... {d} 。而不是%C ... {C} (有点像Python/C#/Java的位置字符串格式ARGS ARGS,而…
如何返回c中的char 2d阵列双指针
#include #define MAX_LEN 20 char *swap_elements(char **arr, int i) { char temp[5]; *temp = *arr; *arr = *(arr+i); *(arr+i) = *temp; return a…
C删除字符串中的字符
现在,我正在使用此代码在字符串中删除一些字符。 void eliminate(char *str, char ch){ for(; *str != '\0';str++){ if(*str == ch){ strcpy(str, st…
strtok is不按预期返回,我在使用错误吗?
#include #include #include // fiter string to the first | char* filterstringfirst(char* command, int i){ char *tok = command; int x = 0; whi…
如何正确构建字符串的 toLower
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. 这个问题是由拼写错误或无法再重现的…