如何将 string data = "68656C6C6F2C776F726C6405050505";复制给DES3_init[]; 谢谢
by mingjie_5200 - C/C++ - 2008-09-05 11:06:38 阅读(15510) 回复(9)
我定义了一个二维字串数组 char str[3][5]。请教下,二维字串如何进行字串的修改呢?比如修改第二个字串的值,我用 str[1] = "tom" 也不行,用 str[1][] = "tom" 也不行,在g++ 3.2.2下却无法编译通过。如果用 str[1][0] = 't' 这样的形式那太麻烦了吧,有没有其它的好的方法呢?多谢!!
inputFile>>t; t是一个对象数组,我想用ifstream对象inputFile对t的每个对象赋值,却出现了error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class teamInf []' (or there is no acceptable conversion)这是为什么啊,应该如何给t赋值啊,假设文件中的数据是 **** ********* *********** **** ********* *********** **** ********* *********** **** ********* *********** **** *****...
代码:
#include "iostream.h"
#include "stdio.h"
#include "string.h"
#include "ctype.h"
struct ylj
{char *ys[8];
struct ylj *next;
};
void main()
{struct ylj *p1;
p1=new ylj;
char ch='a';
(*(p1->;ys[1])+1)=ch;
cout<<"中文"<
看了"网中人"的shell十三问,其中有一个关于单引号和双引号的例子: -------------------------------------------------- $A=b\ >c > $echo $A b c $ --------------------------------------------------- 但今天我试了一下返回的是bc,而不是b(CR)c 我还试了$A='b\ >c > $ 以及 $A="b\ >c > 都不行,请问为什么?
find出来的结果想赋值给数组使用 find . -type f -printf "%u %g %p\n" 查找出来的结果如下 user1 group1 file1 user2 group2 file2
如何将结构体的内容 传给数组? #define INT8U unsigned char typedef struct{ INT8U idname; INT8U idlen; INT8U idvalue[4]; INT8U timename; INT8U timelen; INT8U timevalue[7]; }PACKED S_STRU, *PS_STRU; S_STRU sstru; INT8U sendbuf[1024]; 我这样做行不行? memcpy(sendbuf, &sstru, sizeof(sstru));
比如我有一个文件 root@log:/# more list 4561 diff.sh 6324 list.sh 我想把第一列赋值给一个数组,第二列赋值给另外一个数组。 如何做?我写一个循环去赋值貌似没用,不知道哪里写错了。 请哪位给写个简单的例子看看,非常感谢。
内容如下: /dev/hda2 / none /proc usbdevfs /proc/bus/usb /dev/hda1 /boot none /dev/pts none /dev/shm none /proc/sys/fs/binfmt_misc 行数不定,列数就2列。可以用c或shell。 我是刚开始学编程,还请各位大哥不吝赐教,稍微说的详细的。