请看看这个程序
#include<stdio.h>
#include<string.h>
typedef struct hs_ims_msrp_authority
{
   int     host_type;
   char    buf[50];
   int     port;
}hs_i;
int main()
{
 char dom[50];
 int i = 10, j = 20;
 strcpy(dom, "ine");
 fun((hs_i){i, dom, j});   // doesnt work
 fun((hs_i){i, "dom", j}); // this works
}
int fun(hs_i c)
{
 printf("%d %s %d\n", c.host_type, c.buf, c.port);
}
调用 main 中的 fun 函数;当传递字符串文字(“dom”)时函数调用如何工作,而当传递数组变量(dom)时它不起作用?
为了使变量起作用,它应该以特定的方式进行类型转换吗?还是有其他方法?