64位二进制文​​件将值返回到32位二进制文​​件? [英] A 64-bit binary returning a value to a 32-bit binary?

查看:79
本文介绍了64位二进制文​​件将值返回到32位二进制文​​件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要编译为64位的程序。我有另一个需要编译为32位的

程序,并将调用64位
二进制文件。有没有办法让64位二进制文​​件将字符串返回到32位的
?如果是这样,怎么样?


我能想到的唯一方法就是让32位二进制调用64-

位二进制,然后写到一个文本文件,最后有32位

二进制文件读取它。


有更好的方法吗?

I have a program that needs to be compiled as 64bit. I have another
program that needs to be compiled as 32bit and will call that 64-bit
binary. Is there a way for the 64-bit binary to return a string to
the 32-bit? If so, how?

The only way I could think of is to have the 32-bit binary call the 64-
bit binary, then it writes to a text file and finally have the 32-bit
binary read it off.

Is there a better way to do this?

推荐答案

sp ** ***********@yahoo.ca 写道:

我有一个需要编译为64位的程序。我有另一个需要编译为32位的

程序,并将调用64位
二进制文件。有没有办法让64位二进制文​​件将字符串返回到32位的
?如果是这样,怎么样?


我能想到的唯一方法就是让32位二进制调用64-

位二进制,然后写到一个文本文件,最后有32位

二进制文件读取它。


有更好的方法吗?
I have a program that needs to be compiled as 64bit. I have another
program that needs to be compiled as 32bit and will call that 64-bit
binary. Is there a way for the 64-bit binary to return a string to
the 32-bit? If so, how?

The only way I could think of is to have the 32-bit binary call the 64-
bit binary, then it writes to a text file and finally have the 32-bit
binary read it off.

Is there a better way to do this?



32位二进制文​​件是否支持多长?如果不是,你可能需要按照你写的

来做,或者使用一些非便携式的方法,比如popen(),或者通过套接字调用

64位并读取从标准输出中回来字符串。

但当然所有这些都是偏离主题的:-)。


-

问候,

Stan Milam

=========================== ======================= ===========

平庸吉他协会的特许会员上演

昂贵的乐器有限公司

=========================== ======================= ===========

Does the 32 bit binary support long long? If not you may have to do as
you wrote, or use some non-portable means such as popen(), or invoke the
64 bit via a socket and read back the string from its standard output.
But of course all of that stuff is off-topic :-).

--
Regards,
Stan Milam
================================================== ===========
Charter Member of The Society for Mediocre Guitar Playing on
Expensive Instruments, Ltd.
================================================== ===========


开3月28日晚上11点18分,Stan Milam< stmi ... @ swbell.netwrote:
On Mar 28, 11:18 pm, Stan Milam <stmi...@swbell.netwrote:

spammenotplu ... @ yahoo.ca写道:
spammenotplu...@yahoo.ca wrote:

我有一个需要编译为64位的程序。我有另一个需要编译为32位的

程序,并将调用64位
二进制文件。有没有办法让64位二进制文​​件将字符串返回到32位的
?如果是这样,怎么样?
I have a program that needs to be compiled as 64bit. I have another
program that needs to be compiled as 32bit and will call that 64-bit
binary. Is there a way for the 64-bit binary to return a string to
the 32-bit? If so, how?


我能想到的唯一方法是让32位二进制调用64-

位二进制,然后它写入一个文本文件,最后让32位

二进制文件读取它。
The only way I could think of is to have the 32-bit binary call the 64-
bit binary, then it writes to a text file and finally have the 32-bit
binary read it off.


有更好的方法吗?
Is there a better way to do this?



32位二进制文​​件是否支持多长?如果不是,你可能需要按照你写的

来做,或者使用一些非便携式的方法,比如popen(),或者通过套接字调用

64位并读取从标准输出中回来字符串。

但当然所有这些都是偏离主题的:-)。


-

问候,

Stan Milam

=========================== ======================= ===========

平庸吉他协会的特许会员上演

昂贵的乐器有限公司

=========================== ======================= ===========


Does the 32 bit binary support long long? If not you may have to do as
you wrote, or use some non-portable means such as popen(), or invoke the
64 bit via a socket and read back the string from its standard output.
But of course all of that stuff is off-topic :-).

--
Regards,
Stan Milam
================================================== ===========
Charter Member of The Society for Mediocre Guitar Playing on
Expensive Instruments, Ltd.
================================================== ===========




嗨Stan,


我不擅长C.如果支持很长时间怎么办?什么是

更有效的方式呢?我会使用什么样的函数

为你建议调用套接字的第二种方法?


谢谢! :)



Hi Stan,

I''m not good in C. What if it supports long long? What would be the
more efficient way of doing it? What sort of functions would I use
for the second method you suggested with invoking a socket?

Thanks! :)


On 29 Mrz。,04:58,spammenotplu ... @ yahoo.ca写道:
On 29 Mrz., 04:58, spammenotplu...@yahoo.ca wrote:

3月28日晚上11点18分,Stan Milam< stmi ... @ swbell.netwrote:
On Mar 28, 11:18 pm, Stan Milam <stmi...@swbell.netwrote:

spammenotplu ... @ yahoo .ca写道:
spammenotplu...@yahoo.ca wrote:

我有一个需要编译为64位的程序。我有另一个需要编译为32位的

程序,并将调用64位
二进制文件。有没有办法让64位二进制文​​件将字符串返回到32位的
?如果是这样,怎么样?
I have a program that needs to be compiled as 64bit. I have another
program that needs to be compiled as 32bit and will call that 64-bit
binary. Is there a way for the 64-bit binary to return a string to
the 32-bit? If so, how?


我能想到的唯一方法是让32位二进制调用64 -

位二进制,然后它写入一个文本文件,最后有32位

二进制读取它。
The only way I could think of is to have the 32-bit binary call the 64-
bit binary, then it writes to a text file and finally have the 32-bit
binary read it off.


有更好的方法吗?
Is there a better way to do this?


32位二进制文​​件是否支持多长?如果不是,你可能需要按照你写的

来做,或者使用一些非便携式的方法,比如popen(),或者通过套接字调用

64位并读取从标准输出中返回字符串。

但当然所有这些都是偏离主题的:-)。
Does the 32 bit binary support long long? If not you may have to do as
you wrote, or use some non-portable means such as popen(), or invoke the
64 bit via a socket and read back the string from its standard output.
But of course all of that stuff is off-topic :-).


-

问候,

Stan Milam

================================================== ===========

普通吉他协会的特许会员演奏

昂贵的乐器有限公司

================================================== ===========
--
Regards,
Stan Milam
================================================== ===========
Charter Member of The Society for Mediocre Guitar Playing on
Expensive Instruments, Ltd.
================================================== ===========



嗨斯坦,


我不擅长C如果长时间支持怎么办?什么是

更有效的方式呢?我会使用什么样的函数

为你建议调用套接字的第二种方法?


谢谢! :)


Hi Stan,

I''m not good in C. What if it supports long long? What would be the
more efficient way of doing it? What sort of functions would I use
for the second method you suggested with invoking a socket?

Thanks! :)



Google for IPC,套接字是恕我直言最好的。打开一个端口0的套接字



将给定的端口号传递给被叫方。但是你需要先了解

IPC

来理解上面的句子。

Google for IPC, sockets are IMHO the best. Open a socket with port 0
and
pass the given port number to the callee. But you need to learn about
IPC
first to understand the sentence above.


这篇关于64位二进制文​​件将值返回到32位二进制文​​件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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