C编程 - Linux和OSX之间的差异 [英] Programming in C - Differences between Linux and OSX

查看:114
本文介绍了C编程 - Linux和OSX之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我寻找到C程序设计。

Hello I'm looking into C Programming.

我想知道是否有在C Linux和OSX之间的差异?我知道有一些的Windows和Linux / Unix之间(例如获取系统时间戳)。是否有任何特定的命令或将无法正常工作的两种技术之一?如果基本的节目上都运行?

I'm wondering if there are differences between Linux and OSX in C? I know there are some between Windows and Linux/Unix (like getting a system timestamp). Are there any specific commands or techniques which won't work one of the two? Should "basic" programs run on both?

我知道,C是不是一个交叉编译的语言,但OSX和Linux是Unix的双方 - ?是他们不

I'm aware that C isn't a cross compiling language but OSX and Linux are both Unix - aren't they?

推荐答案

什么样的​​变化不是语言本身,而是库(以及相关的API调用)。有这方面在Mac OSX和Linux之间没有什么区别,只要你坚持使用标准的POSIX调用。在Linux和Mac OSX是POSIX兼容的系统。

What changes is not the language itself, but the libraries (and related API calls). There is no difference between Mac OSX and Linux under this aspect, as long as you stick with standard POSIX calls. Both Linux and Mac OSX are POSIX-compliant systems.

当然,在谈论苹果的专利库时,你不能指望他们在Linux下。但是,这是另一个问题。同为Linux内部。

Of course, when talking about proprietary Apple libraries, you can't expect to find them under Linux. But this is another problem. Same for Linux internals.

请注意,我们正在谈论的的相容性,不会的二进制的兼容性。你不会在所有修改源$ C ​​$ C,但你必须单独编译它为每个平台。

Note that we are talking about source compatibility, not binary compatibility. You won't have to modify your source code at all, but you will have to compile it for each platform separately.

这篇关于C编程 - Linux和OSX之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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