问题描述
大家好,
我想知道为什么我们使用库(静态或共享)。
我们可以通过包含头文件来完成这项工作我也希望
知道究竟是什么链接和加载。
i知道这些都是非常简单和基本的问题。
但是plz帮助我考虑到我是一名新开发者的事实
用C ++。
提前感谢你。
Just Saurabh
Hi all,
I want to know why do we use libraries(static or shared).
We can perform that work by including header files too.I also wish to
know what exactly is linking and loading.
i know these are pretty easy and basic questions.
But plz help me considering the fact that i am a new developer
in C++.
Thanking you in advance.
Just Saurabh
推荐答案
头文件只包含声明(或至少被认为是b $ b),但不是定义。静态/动态库,contian
定义即函数的实现。
HTH,
Divick
Header files contains only the declarations(or at least are supposed
to), but not definitions. Static / dynamic libraries, contian the
definitions i.e the implementation of functions.
HTH,
Divick
头文件只包含声明(或者至少包含
),但不包含定义。静态/动态库,contian
定义即函数的实现。
HTH,
Divick
Header files contains only the declarations(or at least are supposed
to), but not definitions. Static / dynamic libraries, contian the
definitions i.e the implementation of functions.
HTH,
Divick
谢谢很多迪维克。
雅我试过google.But无法得到我想要的东西。头文件只包含声明(或者至少应该包含声明),但不包含定义。静态/动态库,contian
定义,即函数的实现。
Thanks a lot Divick.
Ya i tried google.But couldnt get what i was looking for. Header files contains only the declarations(or at least are supposed
to), but not definitions. Static / dynamic libraries, contian the
definitions i.e the implementation of functions.
但我们也可以在头文件中定义函数。
文件喜欢< stdio.h>,< iostream.h>包含声明
以及定义。
那么我们为什么还要创建库?
我的意思是创建它们会带来什么好处。
Just Saurabh
But we can define functions in header files too.
Files like <stdio.h>, <iostream.h> contains declarations
as well as definitions.
So why do we bother to create libraries?
I mean what benefit we get by creating them.
Just Saurabh
睁大眼睛! ; o)
HTH
Keep your eyes open! ;o)
HTH
这篇关于为什么我们使用图书馆?(抱歉,我是新北京)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!