In a compiled language, you have an intermediate step, in which you take the source code, it runs through what's called a checker or a compiler or both, and it creates what's called object code.
而在编译语言里,你就会经过一个中间的步骤,在这种语言里输入源码后,先经过过滤器,或者编译器检查后,它会创建一个叫做目标代码的东西。
So you're implementing this black box, and if its purpose in life is to actually return a value, you have to tell the compiler what kind of value to expect, and this is going to have ripple effects.
你在实现这个黑盒子,如果它的目的是,返回一个值,你必须告诉编译器你期望的是什么类型的值,这个将是一个连锁反应。
So those are in fact the patterns of zeroes and ones, the bytes that would have been outputted had I hello c remembered to download the compiler to this computer and run it on that little hello.c file.
这些都是0和1的模式,如果我记得下载编译器到计算机上的话,我们就能运行下这个,然后看看输出的字节。
It turns out you can list one, give it a name, and if you use square brackets, that tells the compiler I actually want to put multiple values inside of this -- inside of this variable and how do we do that?
结果是你可以列举一个,给它取个名字,如果你使用方括号,那是告诉编译器,在里面我需要许多的值--在这些变量里,我怎么做到的?
It's a little more involved on a PC but it's all free, the software you can download, and Linux in similar operating systems generally come with a compiler or you run a simple command to get it.
在PC机上有点复杂,但是它是免费的,你一般下载的软件,类似Linux的操作系统等等通常都需要,一个编译器,或者你可以运行一些简单的指令来获取。
> What exactly is the difference with this system that we have here of compiling and say another compiler for one like the C++?
>在这个系统上编译,跟在我们这编译有什么不同吗?,也就是说,有没有其他的编译器供C++等语言使用?
So I tried running a program in this little black and white window called GCC and we'll see it today working properly that is a so called compiler.
在一个名为GCC的黑色小窗口里,运行我们的程序,然后得出想要的结果,这就是所谓的编译器。
- Well -- and I'll fix this blue next time -- I'm first telling the compiler I need access to the standard io library because printf is declared there.
哦!--下次我把这个字体颜色改成蓝色的-,我先告诉编译器--我需要使用,标准输入输出库,因为printf在那个库里面申明的。
And if you don't include it, GCC, the compiler will yell at you.
如果你没有include这个库函数,GCC的时候,编译器就会报错。
So you have to somehow convert the source code, the C code into 0s and 1s and for that process there exist this tool called a compiler that someone else wrote that takes this stuff as input and produces this stuff as output.
所以你必须把源代码,即C语言代码转换成二进制文件,这个过程就需要我们提到的编译器了,它是由别人编写的一个软件,以这些代码作为输入,将会产生的输出。
But the take away for now is that if you don't clue -lcs50, -- you get some mention -- some error message -- about "undefined symbol," and that should be your clue that, "Oh it's undefined in that I haven't told the compiler that I want to link in these zeros and ones."
但现在如果你删除“-lcs50“,你们会得到一些提示--一些错误信息-,像“未定义的符号“,这可以为你提过线索,“这个没有被定义,我没有告诉编译器,把想把这个与“1“和“0“建立连接,“
> What's the difference between a compiler and a Makefile?
>,编译器和Makefile有什么区别?
应用推荐