public string gisoracle = "ok"; private void button2_Click(object sender, EventArgs e) { //通过字符串获得变量值 MessageBox.Show(this.GetType().GetField("gisoracle").GetValue(this).ToString()); //通过给变量赋值 this.GetType().GetField("gisoracle").SetValue(this, "gisoracle@126.com");...
在C中没有工具或库可以将字符串转换为相应的变量、函数或其他任何东西。当你有一个.NET运行时环境时,...
Whether it is through preprocessor directives, predefined identifiers, macros, custom functions, or data structures, developers have several options to choose from when it comes to converting variable names to strings in C programming.总之,虽然C语言没有直接提供将变量名称转换为字符串的方法,但可以采用...
b,c,abc; char * p1; a=3; b=4; c=5; abc=a*b*c; p1=name_to_str(abc); printf("a= %d b= %d c= %d\n",a,b,c); printf("%s= %d %s= %d %s= %d\n",name_to_str(a),