本文介绍了STRCPY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我需要将值复制到char *字段中。 我目前正在这样做 strcpy(cm8link.type [计数],13); 但我收到错误 错误C2664:''strcpy'':无法转换参数1从''const char''到 ''char *'' 这个用来当它只是cm8link.type但它出错了我做到了 cm8link.type [count] 首先为什么? 其次我怎么能得到这个数组的字段值 发生? 谢谢 杰克I need to copy a value into a char * field.I am currently doing thisstrcpy(cm8link.type[count],"13");but I get an error oferror C2664: ''strcpy'' : cannot convert parameter 1 from ''const char'' to''char *''this used to when it was just cm8link.type but it errors when I make itcm8link.type[count]first of all why?secondly how can i get the value into the field for this arrayoccurrence?ThanksJake推荐答案 请发布代码的一个小的可编辑示例,它展示了 问题(以及它的输出)。 - BR,Vladimir 美国人最担心的是,美国会变成现象,而不是文明。 - - Shirley Hazzard,Transit of VenusPlease post a small compilable example of your code that exhibits theproblem (and it''s output).--BR, VladimirAmericans'' greatest fear is that America will turn outto have been a phenomenon, not a civilization.-- Shirley Hazzard, "Transit of Venus" 什么字段?什么阵列?我的该死的水晶球在哪里? 你不能轻易帮助我们。 BrianWhat field? What array? Where''s my damn crystal ball?You don''t make easy for us to help you.Brian 这篇关于STRCPY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!