可能重複: How to pass a multidimensional array to a function in C and C++ 所以我有炭buffer[4][50] 我需要將其傳遞給方法或者至少這是我認爲它應該被格式化的方式。 所以我做SetBuffer(buffer);?在該方法中,我需要每一個元素設置成 void SetBuffer(char **buffer) { strncpy
這是C代碼片段: int main()
{
char *names=[ "tom", "jerry", "scooby" ];
printf("%s", *names[0]);// prints t
printf("%s", *names[1]);// prints j
// how to print full word "tom", or full wo
我知道int (*p)[5]是指一個指向5個整數的指針。 所以我的代碼下面這個方案: #include <iostream>
using namespace std;
int main()
{
int a[5]={0,1,2,3,4};
int (*q)[5]=&a;
cout<<a<<endl;
cout<<q<<endl;
cout