strcpy

    0热度

    2回答

    #include<stdio.h> #include<stdlib.h> #include<ctype.h> #include<string.h> struct person *create_node(char *, char *,int); void addnode(char *,char *,int,struct person *); struct person {

    2热度

    1回答

    这里是我的代码,它在这里出错strcpy(pSrcString,"muppet");事实上,它每当我使用strcpy。 #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char *pSrcString = NULL; char *pDstString = NULL; /* mu

    -2热度

    3回答

    所以strcpy基本上将第二个参数的地址赋值给第一个参数,但它是如何将第一个参数作为数组的呢?就像在我的程序中一样,我试着改变数组的地址,但不幸的是它不会编译。所以我不得不求助于制作一个字符指针变量来指定大写的返回值。有什么我误解? #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char string[2

    3热度

    3回答

    我正在编写我的版本的字符串类,但Valgrind抱怨我的我的字符串执行<<运算符。错误是在错误的行,如果我打印字符char它工程很好。 我在哪里错了? Valgrind的错误: ==2769== Conditional jump or move depends on uninitialised value(s) ==2769== at 0x4C2AC28: strlen (in /usr/lib/

    4热度

    2回答

    我想知道是否有任何不调用任何系统调用()的libc函数?例如,对于libc函数“strcpy()”,是否有任何系统调用(让我们考虑所有可能的linux系统)。

    2热度

    4回答

    我想分配一个char*char*,如果我使用strcpy我得到几个运行时间内存问题,所以我通过使用= operator简单分配来解决它。 任何人都可以解释在使用strcpy之前应该准备的内容以避免内存问题。 编辑: int Function(const char* K,char* FileIN,char* FileOut,int DC) { char *fic_in,*n_fic,*f

    0热度

    3回答

    我需要写一个代码,将这个:你输入名字和名字和一个等级。只有等级大于等于10的学生才会以反向排序的方式打印学生的姓名和名字。 例: Bob Dylan 12 Robert Patt 9 Chris Strozy 15 Josh Sta 11 会给: 克里斯Strozy 15鲍勃·迪伦12乔什站11 我的错误是在strcpy的线路: 太函数'strncpy'|很少有

    0热度

    4回答

    我有这部分的代码: char* data="My name is: "; 我想加入到这个argv[1]参数与代表的名称。如何在c代码中做到这一点?我试过strcpy和strcat,但我有段故障IPCP这样做时: strcpy(data,argv[1]); 任何人都可以请帮助? 另外为什么这样:data=data+argv[1]不工作?

    11热度

    7回答

    我是C初学者,我正在自学。 我创建了以下功能: char *foo(int x){ if(x < 0){ char a[1000]; char b = "blah"; x = x - 1; char *c = foo(x); strcpy(a, b); strcat(a, c); return a;

    2热度

    2回答

    我一直在使用Valgrind的,但由于某些原因,我一直用一个简单的字符串复制两个字符串是相同的大小,在C. 守则影响得到一个内存错误是: node->entry = (char*)malloc(strlen(string)*sizeof(char)); strcpy(node->entry, string); 字符串为:char * string =“Hello There”。 错误是: 大