char *funcNames[]= {"VString","VChar","VArray","VData"};
for(int i=0;i<4;i++)
{
char* temp = funcNames[i];
int len = strlen(funcNames[i]);
for(int j = 0;j<len ;j++)
{
if(j!=0)
{
char arr = temp[j];
}
}
}
Run Code Online (Sandbox Code Playgroud)
在这里我想将"V"与char数组中的所有字符串分开...并在string的开头创建另一个没有"V"的char数组.我想要另一个char数组{String,char,array,data} ... i不能制作一个char数组....帮我解决我的问题......
你真的需要一份副本吗?你可以创建一个指向原始字符串的新数组:
char *newArray[4];
for (i = 0; i < 4; i++) {
newArray[i] = funcNames[i] + 1;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
266 次 |
最近记录: |