Chinaunix

标题: 如何指针数组赋值? [打印本页]

作者: hbszrbw    时间: 2003-11-27 22:54
标题: 如何指针数组赋值?
代码:
#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<<"中文"<<endl;
}

错误提示:
-------------------Configuration: hh - Win32 Debug--------------------
Compiling...
hh.cpp
C:\Documents and Settings\Administrator\桌面\hh.cpp(14) : error C2106: '=' : left operand must be l-value
Error executing cl.exe.

hh.exe - 1 error(s), 0 warning(s)

如何才能给字符串一个字符一个字符的赋值?
谢谢@!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2