什么是变量的类型? [英] What is the type of variable?

查看:183
本文介绍了什么是变量的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Im在Ruby的C扩展工作,我有以下从C程序code,

Im working on Ruby c extension, I have following code from c program,

VALUE var = myFunction(arg1, arg2);
int varType = TYPE(var);
printf("Type of the var is :: %d", varType);

以上的printf给输出如下:

Above printf gives output as follow:

Type of the var is :: 34

由于myFunction是inbuild功能我不知道该函数的返回类型。
任何一个可以告诉我,从myFunction的VAR变量返回的类型?
先谢谢了。

As myFunction is inbuild function i dont know the return type of that function. can any one tell me the type of "var" variable return from myFunction? Thanks in advance.

推荐答案

键入宏返回值://svn.joyent。 COM /开源/ DTrace的/红宝石/红宝石1.8.5 / ruby​​.h相对=nofollow> ruby​​.h 。从那里,它遵循34是T_DATA,其是<一个href=\"http://www.linuxtopia.org/online_books/programming_books/ruby_tutorial/Extending_Ruby_Wrapping_C_Structures.html\"相对=nofollow>封装的C结构。

The TYPE macro returns values enumerated in ruby.h. From there, it follows 34 is T_DATA, which is a wrapped C structure.

这篇关于什么是变量的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆