2D character array initialization in C

前端 未结 4 1474
臣服心动
臣服心动 2021-02-03 10:23

I am trying to build a list of strings that I need to pass to a function expecting char **

How do I build this array? I want to pass in two options, each wi

4条回答
  •  执念已碎
    2021-02-03 10:28

    char **options[2][100];
    

    declares a size-2 array of size-100 arrays of pointers to pointers to char. You'll want to remove one *. You'll also want to put your string literals in double quotes.

提交回复
热议问题