Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将一个数组设置为另一个数组中的字符串。这是在 C 编程中。
gates[gatenum]=&seperation[a+1];
其中a和gatenum都是整数。两个数组都声明为:
a
gatenum
char seperation[3000][100]; char *gates[100][10];
所以基本上我要问的是如何gates[gatenum]设置seperation[a+1]
gates[gatenum]
seperation[a+1]
先感谢您
删除门的第二维。
字符 *门[100];
然后你可以分配 gates[gatenum] = seperation[a+1];
strncpy(gates,seperation,sizeof(gates));