是否有一种方法可以将指针值(不是取消引用的值,而是变量的实际地址)分配给另一个变量?例如
def destroy
ActiveRecord::Base.transaction do
records.destroy_all
error_messages = []
records.each do |record|
error_messages << record.errors.full_messsages if record.errors.present?
raise ActiveRecord::Rollback if error_messages.present?
end
end
end
似乎没有完成这项工作...我每个人得到0,0 ...
答案 0 :(得分:0)
要在c中打印地址,必须发送变量&variable
的地址。
int main(void) {
int i = 0;
printf("The address of the variable is : %p", &i);
}