我正在编写我的版本的字符串类,但Valgrind抱怨我的我的字符串执行<<运算符。错误是在错误的行,如果我打印字符char它工程很好。 我在哪里错了? Valgrind的错误: ==2769== Conditional jump or move depends on uninitialised value(s) ==2769== at 0x4C2AC28: strlen (in /usr/lib/
我需要写一个代码,将这个:你输入名字和名字和一个等级。只有等级大于等于10的学生才会以反向排序的方式打印学生的姓名和名字。 例:
Bob
Dylan
12
Robert
Patt
9
Chris
Strozy
15
Josh
Sta
11
会给: 克里斯Strozy 15鲍勃·迪伦12乔什站11 我的错误是在strcpy的线路: 太函数'strncpy'|很少有
我有这部分的代码: char* data="My name is: ";
我想加入到这个argv[1]参数与代表的名称。如何在c代码中做到这一点?我试过strcpy和strcat,但我有段故障IPCP这样做时: strcpy(data,argv[1]);
任何人都可以请帮助? 另外为什么这样:data=data+argv[1]不工作?