C语言字符串操作

来源:百度知道 编辑:UC知道 时间:2024/06/28 20:14:37
Rcv=SBUF;//从串口接到数据赋给字符串Rcv.

strncpy( * aps_data[0],* Rcv+6,5); //从收到的字符串第一6位起截取5位赋给数组aps_data的第一个元素.
编译不通过,谁指点我一下.

去掉*
strncpy( * aps_data[0],* Rcv+6,5);
用 法: char *strcpy(char *str1, char *str2);
程序例:
#include <stdio.h>
#include <string.h>
int main(void)
{
char string[10];
char *str1 = "abcdefghi";
strcpy(string, str1);
printf("%s\n", string);
return 0;
}

去掉'*'再试